Skip to content

Commit

Permalink
test_get_libctx(): prevent crash when called with NULL provider arg
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from #20257)

(cherry picked from commit 40f3a60)
  • Loading branch information
DDvO committed Apr 18, 2023
1 parent 2522ab0 commit c54050d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/testutil/provider.c
Expand Up @@ -38,7 +38,7 @@ int test_get_libctx(OSSL_LIB_CTX **libctx, OSSL_PROVIDER **default_null_prov,
goto err;
}

if (module_name != NULL
if (provider != NULL && module_name != NULL
&& (*provider = OSSL_PROVIDER_load(new_libctx, module_name)) == NULL) {
opt_printf_stderr("Failed to load provider %s\n", module_name);
goto err;
Expand Down

0 comments on commit c54050d

Please sign in to comment.