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_1-pre1~3032 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=70a06fc1a8b098e9934f837896159bfc6caf0228;p=oweals%2Fopenssl.git 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) --- 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: