Permalink
Browse files

Avoid overflow in MDC2_Update()

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 19, 2016
1 parent 0fff506 commit 1027ad4f34c30b8585592764b9a670ba36888269
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit 1027ad4

Please sign in to comment.