projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef28891
)
Avoid overflow in MDC2_Update()
author
Dr. Stephen Henson
<steve@openssl.org>
Fri, 19 Aug 2016 22:28:29 +0000
(23:28 +0100)
committer
Matt Caswell
<matt@openssl.org>
Wed, 24 Aug 2016 13:12:51 +0000
(14:12 +0100)
Thanks to Shi Lei for reporting this issue.
CVE-2016-6303
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/mdc2/mdc2dgst.c
patch
|
blob
|
history
diff --git
a/crypto/mdc2/mdc2dgst.c
b/crypto/mdc2/mdc2dgst.c
index 6397a47e92dc22d08eda4f556019d1f2e816cc55..37d99f48a5ebcae9f5e16b52ab73e2ed3c24fae2 100644
(file)
--- a/
crypto/mdc2/mdc2dgst.c
+++ b/
crypto/mdc2/mdc2dgst.c
@@
-42,7
+42,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;