4
0
mirror of https://github.com/QuasarApp/openssl.git synced 2025-05-05 22:19:40 +00:00

In d2i_test return error for malloc failure.

Bad ASN.1 data should never be able to trigger a malloc failure so return
an error in d2i_test if a malloc failure occurs.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Dr. Stephen Henson 2016-04-22 18:37:42 +01:00
parent c62981390d
commit 53e409db61

@ -108,6 +108,9 @@ static int execute_test(D2I_TEST_FIXTURE fixture)
ret = 1;
err:
/* Don't indicate success for memory allocation errors */
if (ret == 1 && ERR_GET_REASON(ERR_peek_error()) == ERR_R_MALLOC_FAILURE)
ret = 0;
BIO_free(bio);
OPENSSL_free(der);
ASN1_item_free(value, item_type);