From: Ralph Corderoy Date: Sat, 2 Sep 2017 12:55:29 +0000 (+0100) Subject: decodeBase64(): Limit length of error message on invalid input. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4d19fdf096abcc02a7860b69a445e1998a26917c?ds=sidebyside decodeBase64(): Limit length of error message on invalid input. Screenfuls of email were appearing on stderr. --- diff --git a/sbr/base64.c b/sbr/base64.c index 8426fb2f..995f9556 100644 --- a/sbr/base64.c +++ b/sbr/base64.c @@ -257,7 +257,8 @@ decodeBase64 (const char *encoded, unsigned char **decoded, size_t *len, } if (skip || (((unsigned char) *cp) & 0x80) || (value = b642nib[((unsigned char) *cp) & 0x7f]) > 0x3f) { - inform("invalid BASE64 encoding in %s", cp); + inform("invalid base64 byte %#x: %.42s", + *(unsigned char *)cp, cp); charstring_free (decoded_c); *decoded = NULL;