mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 02:15:40 +01:00
Fix 1 byte overread in mbedtls_asn1_get_int()
This commit is contained in:
parent
cd153278eb
commit
776a6fcd1a
@ -31,13 +31,13 @@ Bugfix
|
|||||||
a contribution from Tobias Tangemann. #541
|
a contribution from Tobias Tangemann. #541
|
||||||
* Fixed cert_app sample program for debug output and for use when no root
|
* Fixed cert_app sample program for debug output and for use when no root
|
||||||
certificates are provided.
|
certificates are provided.
|
||||||
|
* Fix conditional statement that would cause a 1 byte overread in
|
||||||
|
mbedtls_asn1_get_int(). Found and fixed by Guido Vranken.
|
||||||
* Fixed pthread implementation to avoid unintended double initialisations
|
* Fixed pthread implementation to avoid unintended double initialisations
|
||||||
and double frees. (found by Niklas Amnebratt)
|
and double frees. (found by Niklas Amnebratt)
|
||||||
* Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
|
* Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
|
||||||
builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
|
builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
|
||||||
by inestlerode. #559.
|
by inestlerode. #559.
|
||||||
* Fixed default threading implementation to avoid accidental double
|
|
||||||
initialisations and double frees.
|
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* Extended test coverage of special cases, and added new timing test suite.
|
* Extended test coverage of special cases, and added new timing test suite.
|
||||||
|
@ -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 )
|
if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_INTEGER ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
if( len > sizeof( int ) || ( **p & 0x80 ) != 0 )
|
if( len == 0 || len > sizeof( int ) || ( **p & 0x80 ) != 0 )
|
||||||
return( MBEDTLS_ERR_ASN1_INVALID_LENGTH );
|
return( MBEDTLS_ERR_ASN1_INVALID_LENGTH );
|
||||||
|
|
||||||
*val = 0;
|
*val = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user