提交 885d97fb 编写于 作者: J Jiasheng Jiang 提交者: Tomas Mraz

fuzz/fuzz_rand.c: Add check for OSSL_LIB_CTX_new

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: NJiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: NPaul Dale <pauli@openssl.org>
Reviewed-by: NTomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17738)
上级 3d4dd8f2
......@@ -146,6 +146,8 @@ static int fuzz_rand_provider_init(const OSSL_CORE_HANDLE *handle,
const OSSL_DISPATCH **out, void **provctx)
{
*provctx = OSSL_LIB_CTX_new();
if (*provctx == NULL)
return 0;
*out = fuzz_rand_method;
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册