Subtract padding from outlen in ct_base64_decode

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1548)
This commit is contained in:
Rob Percival 2016-10-19 15:11:04 +01:00
parent f7a39a5a3f
commit 70a06fc1a8

View File

@ -45,6 +45,11 @@ static int ct_base64_decode(const char *in, unsigned char **out)
goto err;
}
/* Subtract padding bytes from |outlen| */
while (in[--inlen] == '=') {
--outlen;
}
*out = outbuf;
return outlen;
err: