From: Ralph Dolmans Date: Thu, 10 Sep 2020 10:27:37 +0000 (+0200) Subject: Ignore base64 padding for strings that are supposed to be unpadded. X-Git-Tag: release-1.12.0rc1~22^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39f60718542bd86a7ec3f8fa48ecd62dbc251865;p=thirdparty%2Funbound.git Ignore base64 padding for strings that are supposed to be unpadded. --- diff --git a/sldns/parseutil.c b/sldns/parseutil.c index f5d45823f..9f289d359 100644 --- a/sldns/parseutil.c +++ b/sldns/parseutil.c @@ -735,9 +735,12 @@ static int sldns_b64_pton_base(char const *src, size_t srcsize, uint8_t *target, d = 63; else if(base64url && d == '_') d = 63; - else if(!base64url && d == '=') + else if(d == '=') { + if(!check_padding) + continue; d = 64; - else continue; + } else continue; + in[incount++] = (uint8_t)d; /* work on block of 4, unless padding is not used and there are * less than 4 chars left */