Avoid signed overflow

Found by afl

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

MR: #3013
This commit is contained in:
Kurt Roeckx 2016-06-23 09:37:51 +02:00
parent 24bf6f3c7f
commit 5bea15ebb3

View File

@ -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);