]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
base32_decode*() could incorrectly decode a input.
authorMark Andrews <marka@isc.org>
Thu, 13 Aug 2020 00:22:49 +0000 (10:22 +1000)
committerMark Andrews <marka@isc.org>
Thu, 13 Aug 2020 13:06:55 +0000 (23:06 +1000)
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.

lib/isc/base32.c

index 2c4698413ace0543740629254149ca7016967a61..d280dc2031312c179b9d4dd0eaacfb90543338b5 100644 (file)
@@ -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) {