]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add mfail test for new BIO dgram mem
authorJakub Zelenka <jakub.zelenka@openssl.foundation>
Fri, 8 May 2026 14:42:01 +0000 (16:42 +0200)
committerEugene Syromiatnikov <esyr@openssl.org>
Mon, 11 May 2026 08:09:13 +0000 (10:09 +0200)
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Mon May 11 08:09:16 2026
(Merged from https://github.com/openssl/openssl/pull/31121)

test/bio_dgram_test.c

index 23b47b3adb0068f48cae6c428bcdb0744f251bf5..fab840537ca1a1410e841e83b9122896228ab115 100644 (file)
@@ -776,6 +776,22 @@ err:
     return testresult;
 }
 #endif /* !defined(OPENSSL_NO_CHACHA) */
+
+static int test_bio_dgram_mfail(void)
+{
+    BIO *bio;
+
+    MFAIL_start();
+    bio = BIO_new(BIO_s_dgram_mem());
+    MFAIL_end();
+
+    if (bio == NULL)
+        return 0;
+
+    BIO_free(bio);
+    return 1;
+}
+
 #endif /* !defined(OPENSSL_NO_DGRAM) && !defined(OPENSSL_NO_SOCK) */
 
 int setup_tests(void)
@@ -790,6 +806,7 @@ int setup_tests(void)
 #if !defined(OPENSSL_NO_CHACHA)
     ADD_ALL_TESTS(test_bio_dgram_pair, 3);
 #endif
+    ADD_MFAIL_TEST(test_bio_dgram_mfail);
 #endif
 
     return 1;