Add test for NULL uri handling in OSSL_STORE_delete()

Verify that passing NULL as the uri parameter to OSSL_STORE_delete()
returns 0 rather than crashing with a NULL pointer dereference.

Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Apr  2 07:14:09 2026
(Merged from https://github.com/openssl/openssl/pull/30512)
This commit is contained in:
Weidong Wang
2026-03-24 12:10:28 -05:00
committed by Tomas Mraz
parent c85884a4b2
commit 370954f1bb
+7
View File
@@ -249,6 +249,12 @@ static int test_store_attach_unregistered_scheme(void)
return ret;
}
static int test_store_delete_null_uri(void)
{
/* Passing NULL uri must return 0, not crash */
return TEST_int_eq(OSSL_STORE_delete(NULL, NULL, NULL, NULL, NULL, NULL), 0);
}
const OPTIONS *test_get_options(void)
{
static const OPTIONS test_options[] = {
@@ -303,6 +309,7 @@ int setup_tests(void)
ADD_TEST(test_store_open_winstore);
#endif
ADD_TEST(test_store_search_by_key_fingerprint_fail);
ADD_TEST(test_store_delete_null_uri);
ADD_ALL_TESTS(test_store_get_params, 3);
if (sm2file != NULL)
ADD_TEST(test_store_attach_unregistered_scheme);