summaryrefslogtreecommitdiffstats
path: root/crypto/ct
diff options
context:
space:
mode:
authorRob Percival <robpercival@google.com>2016-10-19 15:11:04 +0100
committerRob Percival <robpercival@google.com>2016-11-16 13:43:36 +0000
commit70a06fc1a8b098e9934f837896159bfc6caf0228 (patch)
tree89073e6633a1a09c7bec27418fbb66a802c45c58 /crypto/ct
parentf7a39a5a3f7f91e0d1ba0030323eef26bc8ccddf (diff)
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)
Diffstat (limited to 'crypto/ct')
-rw-r--r--crypto/ct/ct_b64.c5
1 files changed, 5 insertions, 0 deletions
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: