diff options
author | Rob Percival <robpercival@google.com> | 2016-10-19 15:11:04 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-11-16 16:27:23 -0500 |
commit | bb2b6b6cb7e697a69a1e5cd371a96721a7b89633 (patch) | |
tree | 4f842b8c9f96502f60cf844b35644c550394f02c /crypto/ct | |
parent | 189d4e0906551429dd177af658b5ee37aac2dad3 (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)
(cherry picked from commit 70a06fc1a8b098e9934f837896159bfc6caf0228)
Diffstat (limited to 'crypto/ct')
-rw-r--r-- | crypto/ct/ct_b64.c | 5 |
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: |