diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-06-23 09:37:51 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-06-24 18:17:10 +0200 |
commit | 5bea15ebb359c91a1bb7569620ead14bb71cfb81 (patch) | |
tree | 23fecb5a5962c3b5709ae40456d5e5aa509ea0e6 /crypto/asn1 | |
parent | 24bf6f3c7fccd91b5a9d3ab722c712ef4b0530f9 (diff) |
Avoid signed overflow
Found by afl
Reviewed-by: Rich Salz <rsalz@openssl.org>
MR: #3013
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/x_long.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c index 9d27ba4bc1..0af7875201 100644 --- a/crypto/asn1/x_long.c +++ b/crypto/asn1/x_long.c @@ -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); |