From: Mark Andrews Date: Thu, 13 Aug 2020 00:22:49 +0000 (+1000) Subject: base32_decode*() could incorrectly decode a input. X-Git-Tag: v9.17.5~50^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c7e50c2678f8ecf877f5e580fa75fab59f63373;p=thirdparty%2Fbind9.git base32_decode*() could incorrectly decode a input. base32_decode_char() added a extra zero octet to the output if the fifth character was a pad character. The length of octets to copy to the output was set to 3 instead of 2. --- diff --git a/lib/isc/base32.c b/lib/isc/base32.c index 2c4698413ac..d280dc20313 100644 --- a/lib/isc/base32.c +++ b/lib/isc/base32.c @@ -215,7 +215,7 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) { if ((ctx->val[3] & 0x0f) != 0) { return (ISC_R_BADBASE32); } - ctx->seen_32 = 3; + ctx->seen_32 = 2; break; case 5: if ((ctx->val[4] & 0x01) != 0) {