X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/64e8827c5d5def0325ab7181fe939623c77e807c..ceaab2f46ae8fa4598b9682eaf3210cda21517c9:/sbr/encode_rfc2047.c?ds=sidebyside diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index 581214b7..2c8a3f0d 100644 --- a/sbr/encode_rfc2047.c +++ b/sbr/encode_rfc2047.c @@ -281,16 +281,22 @@ field_encode_quoted(const char *name, char **value, const char *charset, * allow for the encoded output. */ if (column + (utf8len(p) * 3) > ENCODELINELIMIT - 2) { - newline = 1; + newline = 1; } } } + if (q == NULL) { + /* This should never happen, but just in case. Found by + clang static analyzer. */ + admonish (NULL, "null output encoding for %s", *value); + return 1; + } *q++ = '?'; *q++ = '='; if (prefixlen) - *q++ = '\n'; + *q++ = '\n'; *q = '\0';