Files
Jakub Zelenka 3cff7c2181 Add memory allocation failure testing framework
Introduce ADD_MFAIL_TEST for exhaustive testing of allocation failure
handling in individual functions. The framework repeatedly calls the
test function, each time failing one allocation later within the
section bracketed by mfail_start() and mfail_end(), verifying that
every failure path returns 0 without crashing or leaking.

Custom allocators are installed once at startup via
CRYPTO_set_mem_functions(). When not armed, they pass through to
malloc/realloc/free. Installation can be disabled by setting
OPENSSL_TEST_MFAIL_DISABLE for tests that need the default allocator
(e.g. those using OPENSSL_MALLOC_FAILURES).

Additional environment variables control test execution:
OPENSSL_TEST_MFAIL_SKIP_ALL, OPENSSL_TEST_MFAIL_SKIP_SLOW,
OPENSSL_TEST_MFAIL_POINT, and OPENSSL_TEST_MFAIL_START.

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Thu Apr 23 20:23:34 2026
(Merged from https://github.com/openssl/openssl/pull/30871)
2026-04-23 20:22:45 +00:00
..
2025-03-12 13:35:59 +00:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00