Skip to content

Commit

Permalink
Fix missing NULL check in prov_config_test
Browse files Browse the repository at this point in the history
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 #24198)

(cherry picked from commit a380ec9)
  • Loading branch information
nhorman authored and t8m committed Apr 26, 2024
1 parent 25e1d8d commit 491ff1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/prov_config_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 491ff1b

Please sign in to comment.