aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/test/property_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/test/property_test.c')
-rw-r--r--crypto/openssl/test/property_test.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/crypto/openssl/test/property_test.c b/crypto/openssl/test/property_test.c
index 18f8cc8740e0..e62ff247c42c 100644
--- a/crypto/openssl/test/property_test.c
+++ b/crypto/openssl/test/property_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -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;
}