From cd62f2b716a2e5f87c45719136a7298e8cbce926 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Tue, 15 Oct 2019 18:37:10 +0100 Subject: [PATCH] Don't include OpenSSL headers in config.h. Add an include of stdlib.h to various files that were relying on config.h to drag it in. I don't think config.h should be pulling in standard C headers. --- cmake/include/cmakeconfig.h.in | 24 ------------------------ src/gldns/gbuffer.c | 1 + src/gldns/parse.c | 1 + src/gldns/rrdef.c | 2 ++ src/gldns/str2wire.c | 1 + src/util/lruhash.c | 2 ++ src/util/rbtree.c | 2 ++ 7 files changed, 9 insertions(+), 24 deletions(-) diff --git a/cmake/include/cmakeconfig.h.in b/cmake/include/cmakeconfig.h.in index 2bc1930d..38d18aff 100644 --- a/cmake/include/cmakeconfig.h.in +++ b/cmake/include/cmakeconfig.h.in @@ -371,30 +371,6 @@ static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *fo #include #endif -#ifdef HAVE_OPENSSL_SSL_H -#include -#endif - -#ifdef HAVE_OPENSSL_EVP_H -#include -#endif - -#ifdef HAVE_OPENSSL_ERR_H -#include -#endif - -#ifdef HAVE_OPENSSL_RAND_H -#include -#endif - -#ifdef HAVE_OPENSSL_CONF_H -#include -#endif - -#ifdef HAVE_OPENSSL_ENGINE_H -#include -#endif - #ifdef PATH_MAX #define _GETDNS_PATH_MAX PATH_MAX #else diff --git a/src/gldns/gbuffer.c b/src/gldns/gbuffer.c index 3b39f438..5bf3fc6d 100644 --- a/src/gldns/gbuffer.c +++ b/src/gldns/gbuffer.c @@ -14,6 +14,7 @@ #include "config.h" #include "gldns/gbuffer.h" #include +#include gldns_buffer * gldns_buffer_new(size_t capacity) diff --git a/src/gldns/parse.c b/src/gldns/parse.c index 64fe67cb..0d9b6703 100644 --- a/src/gldns/parse.c +++ b/src/gldns/parse.c @@ -13,6 +13,7 @@ #include "gldns/gbuffer.h" #include +#include gldns_lookup_table gldns_directive_types[] = { { GLDNS_DIR_TTL, "$TTL" }, diff --git a/src/gldns/rrdef.c b/src/gldns/rrdef.c index 114f807e..b7df1f27 100644 --- a/src/gldns/rrdef.c +++ b/src/gldns/rrdef.c @@ -16,6 +16,8 @@ #include "gldns/rrdef.h" #include "gldns/parseutil.h" +#include + /* classes */ static gldns_lookup_table gldns_rr_classes_data[] = { { GLDNS_RR_CLASS_IN, "IN" }, diff --git a/src/gldns/str2wire.c b/src/gldns/str2wire.c index 708df50e..45dd1f0c 100644 --- a/src/gldns/str2wire.c +++ b/src/gldns/str2wire.c @@ -24,6 +24,7 @@ #ifdef HAVE_NETDB_H #include #endif +#include /** return an error */ #define RET_ERR(e, off) ((int)((e)|((off)< + #include "config.h" #include "util/storage/lruhash.h" #include "util/fptr_wlist.h" diff --git a/src/util/rbtree.c b/src/util/rbtree.c index ff4e3e46..b1a94b78 100644 --- a/src/util/rbtree.c +++ b/src/util/rbtree.c @@ -39,6 +39,8 @@ * Implementation of a redblack tree. */ +#include + #include "config.h" #include "log.h" #include "fptr_wlist.h"