mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 12:05:36 +01:00
Fix memory leak in mbedtls_x509_crl_parse()
The memory leak call was caused by missing calls to mbedtls_pem_free() when a MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT error was encountered.
This commit is contained in:
parent
87c980749d
commit
5708dcb368
@ -42,6 +42,9 @@ Bugfix
|
|||||||
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
|
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
|
||||||
* Fixed heap overreads in mbedtls_x509_get_time(). Found by Peng
|
* Fixed heap overreads in mbedtls_x509_get_time(). Found by Peng
|
||||||
Li/Yueh-Hsun Lin, KNOX Security, Samsung Research America.
|
Li/Yueh-Hsun Lin, KNOX Security, Samsung Research America.
|
||||||
|
* Fix potential memory leak in mbedtls_x509_crl_parse(). The leak was caused
|
||||||
|
by missing calls to mbedtls_pem_free() in cases when a
|
||||||
|
MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT error was encountered.
|
||||||
|
|
||||||
= mbed TLS 2.4.1 branch released 2016-12-13
|
= mbed TLS 2.4.1 branch released 2016-12-13
|
||||||
|
|
||||||
|
@ -525,16 +525,17 @@ int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, s
|
|||||||
if( ( ret = mbedtls_x509_crl_parse_der( chain,
|
if( ( ret = mbedtls_x509_crl_parse_der( chain,
|
||||||
pem.buf, pem.buflen ) ) != 0 )
|
pem.buf, pem.buflen ) ) != 0 )
|
||||||
{
|
{
|
||||||
|
mbedtls_pem_free( &pem );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_pem_free( &pem );
|
|
||||||
}
|
}
|
||||||
else if( is_pem )
|
else if( is_pem )
|
||||||
{
|
{
|
||||||
mbedtls_pem_free( &pem );
|
mbedtls_pem_free( &pem );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mbedtls_pem_free( &pem );
|
||||||
}
|
}
|
||||||
/* In the PEM case, buflen is 1 at the end, for the terminated NULL byte.
|
/* In the PEM case, buflen is 1 at the end, for the terminated NULL byte.
|
||||||
* And a valid CRL cannot be less than 1 byte anyway. */
|
* And a valid CRL cannot be less than 1 byte anyway. */
|
||||||
|
Loading…
Reference in New Issue
Block a user