From 14ffe02a45aeb34b0c535b74dae8c97bec123885 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Mon, 12 Jun 2017 10:37:37 +0900 Subject: [PATCH] Avoid overflow in MDC2_Update() Change-Id: I11dfad2f10827602680ff348534f7afe8299da54 Signed-off-by: min7.choi --- deps/openssl/openssl/crypto/mdc2/mdc2dgst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c index 6615cf8..2dce493 100644 --- a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c +++ b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c @@ -91,7 +91,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len) i = c->num; if (i != 0) { - if (i + len < MDC2_BLOCK) { + if (len < MDC2_BLOCK - i) { /* partial block */ memcpy(&(c->data[i]), in, len); c->num += (int)len; -- 2.7.4