From: Neil Horman Date: Fri, 19 Apr 2024 14:17:54 +0000 (-0400) Subject: Fix missing NULL check in prov_config_test X-Git-Tag: openssl-3.1.6~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a380ec952f138f644d227637eeba90fd1e17f72f;p=thirdparty%2Fopenssl.git Fix missing NULL check in prov_config_test coverity-1596500 caught a missing null check. We should never hit it as the test harness always sets the environment variable, but lets add the check for safety Reviewed-by: Tomas Mraz Reviewed-by: Tom Cosgrove Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24198) --- diff --git a/test/prov_config_test.c b/test/prov_config_test.c index fee2dffdb20..4f0cbc247b4 100644 --- a/test/prov_config_test.c +++ b/test/prov_config_test.c @@ -83,6 +83,9 @@ static int test_path_config(void) char *full_path = NULL; int rc; + if (!TEST_ptr(module_path)) + return 0; + full_path = OPENSSL_zalloc(strlen(module_path) + strlen(P_TEST_PATH) + 1); if (!TEST_ptr(full_path)) return 0;