From: Viktor Dukhovni Date: Mon, 22 Sep 2025 05:02:28 +0000 (+1000) Subject: Added test suggested by Shane Lontis X-Git-Tag: openssl-3.4.3~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9265f7f702d719a7ff47926804adf886e317c449;p=thirdparty%2Fopenssl.git Added test suggested by Shane Lontis Reviewed-by: Paul Dale Reviewed-by: Tom Cosgrove Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/28624) (cherry picked from commit 38e8981004308ed6d7cdbd3178c826989a30e31a) --- diff --git a/test/property_test.c b/test/property_test.c index 18f8cc8740e..d908d398e50 100644 --- a/test/property_test.c +++ b/test/property_test.c @@ -687,6 +687,22 @@ static int test_property_list_to_string(int i) return ret; } +static int test_property_list_to_string_bounds(void) +{ + OSSL_PROPERTY_LIST *pl = NULL; + char buf[16]; + int ret = 0; + + if (!TEST_ptr(pl = ossl_parse_query(NULL, "provider='$1'", 1))) + goto err; + if (!TEST_size_t_eq(ossl_property_list_to_string(NULL, pl, buf, 10), 14)) + goto err; + ret = 1; + err: + ossl_property_free(pl); + return ret; +} + int setup_tests(void) { ADD_TEST(test_property_string); @@ -701,5 +717,6 @@ int setup_tests(void) ADD_TEST(test_query_cache_stochastic); ADD_TEST(test_fips_mode); ADD_ALL_TESTS(test_property_list_to_string, OSSL_NELEM(to_string_tests)); + ADD_TEST(test_property_list_to_string_bounds); return 1; }