summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-04-27 11:13:56 +0100
committerMatt Caswell <matt@openssl.org>2015-04-30 23:21:53 +0100
commit33c99f2c8169807660b46d49c3e735cfa09a6e0c (patch)
treec000d25f3bf8447c74945c09682edb2e541842ed /crypto/evp
parent1a3701f4fe0530a40ec073cd78d02cfcc26c0f8e (diff)
Sanity check EVP_EncodeUpdate buffer len
There was already a sanity check to ensure the passed buffer length is not zero. Extend this to ensure that it also not negative. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit b86d7dca69f5c80abd60896c8ed3039fc56210cc)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/encode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c
index 53cc586396..c361d1f012 100644
--- a/crypto/evp/encode.c
+++ b/crypto/evp/encode.c
@@ -137,7 +137,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
unsigned int total = 0;
*outl = 0;
- if (inl == 0)
+ if (inl <= 0)
return;
OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
if ((ctx->num + inl) < ctx->length) {