From: Weidong Wang Date: Tue, 24 Mar 2026 17:10:28 +0000 (-0500) Subject: Add test for NULL uri handling in OSSL_STORE_delete() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=370954f1bbdcb9d706db990baccf6f0dcbe5dde7;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Eugene Syromiatnikov Reviewed-by: Paul Dale MergeDate: Thu Apr 2 07:14:09 2026 (Merged from https://github.com/openssl/openssl/pull/30512) --- diff --git a/test/ossl_store_test.c b/test/ossl_store_test.c index f251313d1a6..104ae3ad610 100644 --- a/test/ossl_store_test.c +++ b/test/ossl_store_test.c @@ -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);