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 b86d7dca69
)
This commit is contained in:
parent
974d4d675c
commit
951ede2a06
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue