]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - test/stack_test.c
Allow NULL arg to OPENSSL_sk_{dup,deep_copy} returning empty stack
[thirdparty/openssl.git] / test / stack_test.c
index 0c1648da770fb76d1fb1da70874b80f1b2bc0d70..e59acd353b9bd9d1bd7c84c8e9cf0b85f6e65e8e 100644 (file)
@@ -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;