From: Dr. David von Oheimb Date: Wed, 1 Feb 2023 14:34:19 +0000 (+0100) Subject: test_get_libctx(): prevent crash when called with NULL provider arg X-Git-Tag: openssl-3.2.0-alpha1~1292 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13cb5416f4dbbf50690fe129894e2856623af21c;p=thirdparty%2Fopenssl.git test_get_libctx(): prevent crash when called with NULL provider arg Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20190) --- diff --git a/test/testutil/provider.c b/test/testutil/provider.c index 199e4f03af9..900324d81b0 100644 --- a/test/testutil/provider.c +++ b/test/testutil/provider.c @@ -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;