From d53b437f9992f974c1623e9b9b9bdf053aefbcc3 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Wed, 23 Dec 2020 19:33:03 +0100 Subject: Allow NULL arg to OPENSSL_sk_{dup,deep_copy} returning empty stack This simplifies many usages Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14040) --- test/stack_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/stack_test.c') diff --git a/test/stack_test.c b/test/stack_test.c index 0c1648da77..e59acd353b 100644 --- a/test/stack_test.c +++ b/test/stack_test.c @@ -195,6 +195,10 @@ static int test_uchar_stack(int reserve) goto end; /* dup */ + r = sk_uchar_dup(NULL); + if (sk_uchar_num(r) != 0) + goto end; + sk_uchar_free(r); r = sk_uchar_dup(s); if (!TEST_int_eq(sk_uchar_num(r), n)) goto end; @@ -291,6 +295,10 @@ static int test_SS_stack(void) goto end; /* deepcopy */ + r = sk_SS_deep_copy(NULL, &SS_copy, &SS_free); + if (sk_SS_num(r) != 0) + goto end; + sk_SS_free(r); r = sk_SS_deep_copy(s, &SS_copy, &SS_free); if (!TEST_ptr(r)) goto end; -- cgit v1.2.3