mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-05 20:15:36 +02:00
Prevent NULL pointer dereference in x509_ocsp.c
Add a check at the beginning of the function mbedtls_x509_ocsp_response_free() to ensure that the pointer passed to is not NULL. This prevent a NULL pointer dereference that could lead to crashes.
This commit is contained in:
committed by
Andres Amaya Garcia
parent
3140f2fac5
commit
03b02e3277
@@ -79,7 +79,9 @@ void mbedtls_x509_ocsp_response_free( mbedtls_x509_ocsp_response *resp )
|
||||
{
|
||||
mbedtls_x509_ocsp_single_response *cur, *next;
|
||||
|
||||
if( resp->resp_type.p == NULL )
|
||||
if( resp == NULL )
|
||||
return;
|
||||
else if( resp->raw.p == NULL )
|
||||
goto exit;
|
||||
|
||||
/* Free list of certificates */
|
||||
|
||||
Reference in New Issue
Block a user