Commit 5bea15eb authored by Kurt Roeckx's avatar Kurt Roeckx
Browse files

Avoid signed overflow



Found by afl

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

MR: #3013
parent 24bf6f3c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -128,8 +128,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);