]> diplodocus.org Git - nmh/commitdiff
decodeBase64(): Limit length of error message on invalid input.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 2 Sep 2017 12:55:29 +0000 (13:55 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 2 Sep 2017 13:08:16 +0000 (14:08 +0100)
Screenfuls of email were appearing on stderr.

sbr/base64.c

index 8426fb2..995f955 100644 (file)
@@ -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;