From: Pauli Date: Thu, 28 Sep 2023 01:34:48 +0000 (+1000) Subject: Coverity 1545176: dereference before NULL check X-Git-Tag: openssl-3.2.0-beta1~164 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=15410839c668f97b5c03ee1a1bc1a2bf4315715f Coverity 1545176: dereference before NULL check Reviewed-by: Tomas Mraz Reviewed-by: Tom Cosgrove (Merged from https://github.com/openssl/openssl/pull/22211) --- diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 46e294a378..7fbbb0275b 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -536,13 +536,14 @@ static EVP_RAND_CTX *rand_new_seed(OSSL_LIB_CTX *libctx) EVP_RAND *rand; RAND_GLOBAL *dgbl = rand_get_global(libctx); EVP_RAND_CTX *ctx = NULL; - const char *propq = dgbl->seed_propq; + const char *propq; char *name, *props = NULL; size_t props_len; OSSL_PROPERTY_LIST *pl1, *pl2, *pl3 = NULL; if (dgbl == NULL) return NULL; + propq = dgbl->seed_propq; if (dgbl->seed_name != NULL) { name = dgbl->seed_name; } else {