diff options
author | 2019-04-15 17:46:02 +0000 | |
---|---|---|
committer | 2019-04-15 17:46:02 +0000 | |
commit | 153600079e87aff4308a10edc2b6a1f1d8b8225c (patch) | |
tree | f719826d143866bb67f693b42998d85346a8fb36 | |
parent | Remove old vlan and [-]vlandev code (diff) | |
download | wireguard-openbsd-153600079e87aff4308a10edc2b6a1f1d8b8225c.tar.xz wireguard-openbsd-153600079e87aff4308a10edc2b6a1f1d8b8225c.zip |
Avoid signed integer overflow.
Fixes oss-fuzz issue #13843.
ok tb@
-rw-r--r-- | lib/libcrypto/asn1/x_long.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/asn1/x_long.c b/lib/libcrypto/asn1/x_long.c index 61685c31a37..8b11f14217f 100644 --- a/lib/libcrypto/asn1/x_long.c +++ b/lib/libcrypto/asn1/x_long.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_long.c,v 1.14 2019/04/01 15:48:50 jsing Exp $ */ +/* $OpenBSD: x_long.c,v 1.15 2019/04/15 17:46:02 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -195,8 +195,8 @@ long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, } ltmp = (long)utmp; if (neg) { - ltmp++; ltmp = -ltmp; + ltmp--; } if (ltmp == it->size) { ASN1error(ASN1_R_INTEGER_TOO_LARGE_FOR_LONG); |