Commit 1027ad4f authored by Dr. Stephen Henson's avatar Dr. Stephen Henson Committed by Matt Caswell
Browse files

Avoid overflow in MDC2_Update()



Thanks to Shi Lei for reporting this issue.

CVE-2016-6303

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(cherry picked from commit 55d83bf7)
parent 0fff5065
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;