Merge branch '4000-openssl-attr-malloc-vs-cmocka-define-malloc-9.18' into 'bind-9.18'

[9.18] unit tests: include an OpenSSL header before including cmocka.h

See merge request isc-projects/bind9!7842
This commit is contained in:
Arаm Sаrgsyаn 2023-04-14 13:33:08 +00:00
commit deb5a89962
7 changed files with 47 additions and 0 deletions

View file

@ -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]

View file

@ -19,6 +19,13 @@
#include <string.h>
#include <unistd.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>

View file

@ -19,6 +19,13 @@
#include <stdlib.h>
#include <unistd.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>

View file

@ -20,6 +20,13 @@
#include <string.h>
#include <unistd.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>

View file

@ -22,6 +22,13 @@
#include <unistd.h>
#include <uv.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>

View file

@ -20,6 +20,13 @@
#include <stdlib.h>
#include <string.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>

View file

@ -19,6 +19,13 @@
#include <unistd.h>
#include <uv.h>
/*
* 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 <openssl/err.h>
#define UNIT_TESTING
#include <cmocka.h>