X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b24a1b1ac51ca3bbacc82700dd1388b7dae2633d..f1920d78123667716f2321d37ce37628603b2700:/sbr/encode_rfc2047.c diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index 537a275e..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'; @@ -568,7 +574,7 @@ field_encode_address(const char *name, char **value, int encoding, for (groupflag = 0; (mp = getname(*value)); ) { if ((mn = getm(mp, NULL, 0, errbuf, sizeof(errbuf))) == NULL) { - advise(mp, "%s", errbuf); + advise(NULL, "%s: %s", errbuf, mp); errflag++; continue; }