projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Avoid overflow in EVP_EncodeUpdate
[openssl.git]
/
crypto
/
evp
/
encode.c
diff --git
a/crypto/evp/encode.c
b/crypto/evp/encode.c
index ed85f8933bc01f01cea67d39650cb960a69d6247..6f862fa2dd2c8c158437d225b7683806d7c673ea 100644
(file)
--- a/
crypto/evp/encode.c
+++ b/
crypto/evp/encode.c
@@
-171,7
+171,7
@@
void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
if (inl <= 0)
return;
OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
- if (
(ctx->num + inl) < ctx->length
) {
+ if (
ctx->length - ctx->num > inl
) {
memcpy(&(ctx->enc_data[ctx->num]), in, inl);
ctx->num += inl;
return;