mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Fix 1 byte overread in mbedtls_asn1_get_int()
This commit is contained in:
parent
cd153278eb
commit
776a6fcd1a
2 changed files with 3 additions and 3 deletions
|
|
@ -153,7 +153,7 @@ int mbedtls_asn1_get_int( unsigned char **p,
|
|||
if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_INTEGER ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
if( len > sizeof( int ) || ( **p & 0x80 ) != 0 )
|
||||
if( len == 0 || len > sizeof( int ) || ( **p & 0x80 ) != 0 )
|
||||
return( MBEDTLS_ERR_ASN1_INVALID_LENGTH );
|
||||
|
||||
*val = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue