[go: nahoru, domu]

Skip to content

Commit

Permalink
Avoid overflow in MDC2_Update()
Browse files Browse the repository at this point in the history
Thanks to Shi Lei for reporting this issue.

CVE-2016-6303

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 55d83bf)
  • Loading branch information
snhenson authored and mattcaswell committed Aug 24, 2016
1 parent 0fff506 commit 1027ad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/mdc2/mdc2dgst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1027ad4

Please sign in to comment.