Skip to content

Commit d0666f2

Browse files
author
Geoff Thorpe
committed
evp: prevent underflow in base64 decoding
This patch resolves RT ticket #2608. Thanks to Robert Dugal for originally spotting this, and to David Ramos for noticing that the ball had been dropped. Signed-off-by: Geoff Thorpe <geoff@openssl.org>
1 parent d8afda6 commit d0666f2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: crypto/evp/encode.c

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
324324
v=EVP_DecodeBlock(out,d,n);
325325
n=0;
326326
if (v < 0) { rv=0; goto end; }
327+
if (eof > v) { rv=-1; goto end; }
327328
ret+=(v-eof);
328329
}
329330
else

0 commit comments

Comments
 (0)