mirror of
https://github.com/openssl/openssl.git
synced 2026-05-07 20:12:39 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user