diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-12-23 19:33:03 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-02-04 07:28:11 +0100 |
commit | d53b437f9992f974c1623e9b9b9bdf053aefbcc3 (patch) | |
tree | 12b15a5d0a6e885be5e9118c5b4542c6234039f0 /test/stack_test.c | |
parent | run_tests.pl: Improve diagnostics on the use of HARNESS_JOBS (diff) | |
download | openssl-d53b437f9992f974c1623e9b9b9bdf053aefbcc3.tar.xz openssl-d53b437f9992f974c1623e9b9b9bdf053aefbcc3.zip |
Allow NULL arg to OPENSSL_sk_{dup,deep_copy} returning empty stack
This simplifies many usages
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14040)
Diffstat (limited to 'test/stack_test.c')
-rw-r--r-- | test/stack_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; |