From: Rob Percival Date: Wed, 19 Oct 2016 14:11:04 +0000 (+0100) Subject: Subtract padding from outlen in ct_base64_decode X-Git-Tag: OpenSSL_1_1_0d~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb2b6b6cb7e697a69a1e5cd371a96721a7b89633;p=openssl Subtract padding from outlen in ct_base64_decode Reviewed-by: Tim Hudson Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1548) (cherry picked from commit 70a06fc1a8b098e9934f837896159bfc6caf0228) --- diff --git a/crypto/ct/ct_b64.c b/crypto/ct/ct_b64.c index d13d8f2af2..636ac4f5d2 100644 --- a/crypto/ct/ct_b64.c +++ b/crypto/ct/ct_b64.c @@ -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: