From 70a06fc1a8b098e9934f837896159bfc6caf0228 Mon Sep 17 00:00:00 2001 From: Rob Percival Date: Wed, 19 Oct 2016 15:11:04 +0100 Subject: [PATCH] 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) --- crypto/ct/ct_b64.c | 5 +++++ 1 file changed, 5 insertions(+) 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: -- 2.25.1