Commit 2cbd4d98 authored by Kurt Roeckx's avatar Kurt Roeckx Committed by Richard Levitte
Browse files

Avoid signed overflow



Found by afl

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>

MR: #3013
(cherry picked from commit 5bea15eb)
parent e6c53b0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,8 +178,8 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
    }
    ltmp = (long)utmp;
    if (neg) {
        ltmp++;
        ltmp = -ltmp;
        ltmp--;
    }
    if (ltmp == it->size) {
        ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);