diff options
Diffstat (limited to 'src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c')
-rw-r--r-- | src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c b/src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c index e596e072..e00702d1 100644 --- a/src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c +++ b/src/ltc/pk/asn1/der/short_integer/der_decode_short_integer.c @@ -42,6 +42,10 @@ int der_decode_short_integer(const unsigned char *in, unsigned long inlen, unsig return CRYPT_INVALID_PACKET; } + if (len > sizeof(unsigned long)) { + return CRYPT_OVERFLOW; + } + /* read number */ y = 0; while (len--) { |