diff options
author | Neil Horman <nhorman@openssl.org> | 2024-04-19 10:17:54 -0400 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-04-26 14:06:34 +0200 |
commit | 491ff1b13bdabad24384cc0c19c6dd7532693613 (patch) | |
tree | ce57622fef8d28cddf653c35149d21d25d2adcac | |
parent | 25e1d8dcdedaa0e99218b4dd24f82a11f2a470eb (diff) |
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 <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24198)
(cherry picked from commit a380ec952f138f644d227637eeba90fd1e17f72f)
-rw-r--r-- | test/prov_config_test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/prov_config_test.c b/test/prov_config_test.c index fee2dffdb2..4f0cbc247b 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; |