As the potential failure of the OPENSSL_zalloc(), the OSSL_LIB_CTX_new()
could return NULL.
Therefore, it should be better to check it and return error if fails in
order to guarantee the success of the initialization.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17738)
const OSSL_DISPATCH **out, void **provctx)
{
*provctx = OSSL_LIB_CTX_new();
+ if (*provctx == NULL)
+ return 0;
*out = fuzz_rand_method;
return 1;
}