diff --git a/CHANGES b/CHANGES index cc153cb29d..9c3e14cdd4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +6149. [test] As a workaround, include an OpenSSL header file before + including cmocka.h in the unit tests, because OpenSSL + 3.1.0 uses __attribute__(malloc), conflicting with a + redefined malloc in cmocka.h. [GL #4000] + 6145. [bug] Fix a possible use-after-free bug in the dns__catz_done_cb() function. [GL #3997] diff --git a/tests/dns/dh_test.c b/tests/dns/dh_test.c index 246de2197a..9358a8f61f 100644 --- a/tests/dns/dh_test.c +++ b/tests/dns/dh_test.c @@ -19,6 +19,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include diff --git a/tests/dns/dst_test.c b/tests/dns/dst_test.c index f18bd2f359..0fecb908ea 100644 --- a/tests/dns/dst_test.c +++ b/tests/dns/dst_test.c @@ -19,6 +19,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include diff --git a/tests/dns/rsa_test.c b/tests/dns/rsa_test.c index 40652541f5..c814ab68d9 100644 --- a/tests/dns/rsa_test.c +++ b/tests/dns/rsa_test.c @@ -20,6 +20,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include diff --git a/tests/isc/doh_test.c b/tests/isc/doh_test.c index ab74813cff..090fb8f318 100644 --- a/tests/isc/doh_test.c +++ b/tests/isc/doh_test.c @@ -22,6 +22,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include diff --git a/tests/isc/hmac_test.c b/tests/isc/hmac_test.c index ac567d6884..3d459d0a18 100644 --- a/tests/isc/hmac_test.c +++ b/tests/isc/hmac_test.c @@ -20,6 +20,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include diff --git a/tests/isc/netmgr_test.c b/tests/isc/netmgr_test.c index 1527c68112..b2745521f7 100644 --- a/tests/isc/netmgr_test.c +++ b/tests/isc/netmgr_test.c @@ -19,6 +19,13 @@ #include #include +/* + * As a workaround, include an OpenSSL header file before including cmocka.h, + * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a + * redefined malloc in cmocka.h. + */ +#include + #define UNIT_TESTING #include