fuzz/fuzz_rand.c: Add check for OSSL_LIB_CTX_new
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 21 Feb 2022 02:10:23 +0000 (10:10 +0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 28 Feb 2022 11:17:17 +0000 (12:17 +0100)
commit445925de2f8064328c76145190b403c3c1dd8d0f
tree605c3b810371c7137b84f4b3de0a6d5081c55d63
parent412403e9dca9c6391f957c92b54777767a9bca21
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: 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)

(cherry picked from commit 885d97fbf84fb9de7548a5f6d4e90798f719022a)
fuzz/fuzz_rand.c