]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for oss-fuzz build warning.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 19 Sep 2019 08:09:49 +0000 (10:09 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 19 Sep 2019 08:09:49 +0000 (10:09 +0200)
config.h.in
configure
configure.ac
doc/Changelog

index 1e092fd5b2015a6d8da5e926ec27e5fd6dbe830a..d8ec50a6d7669cd5a275b95f9642278e9ec967d6 100644 (file)
@@ -1221,6 +1221,10 @@ struct tm;
 char *strptime(const char *s, const char *format, struct tm *tm);
 #endif
 
+#if !HAVE_DECL_REALLOCARRAY
+void *reallocarray(void *ptr, size_t nmemb, size_t size);
+#endif
+
 #ifdef HAVE_LIBRESSL
 #  if !HAVE_DECL_STRLCPY
 size_t strlcpy(char *dst, const char *src, size_t siz);
@@ -1234,9 +1238,6 @@ uint32_t arc4random(void);
 #  if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
 uint32_t arc4random_uniform(uint32_t upper_bound);
 #  endif
-#  if !HAVE_DECL_REALLOCARRAY
-void *reallocarray(void *ptr, size_t nmemb, size_t size);
-#  endif
 #endif /* HAVE_LIBRESSL */
 #ifndef HAVE_ARC4RANDOM
 int getentropy(void* buf, size_t len);
index cbbc177f2df9e9df032fbc94e01f01b6f5881011..0d49decdd66df3d26b83ccff960688b261b49e50 100755 (executable)
--- a/configure
+++ b/configure
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_ARC4RANDOM_UNIFORM $ac_have_decl
 _ACEOF
-ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "$ac_includes_default"
-if test "x$ac_cv_have_decl_reallocarray" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_REALLOCARRAY $ac_have_decl
-_ACEOF
 
 else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -20222,6 +20212,17 @@ esac
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "$ac_includes_default"
+if test "x$ac_cv_have_decl_reallocarray" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_REALLOCARRAY $ac_have_decl
+_ACEOF
+
 if test "$USE_NSS" = "no"; then
        ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
 if test "x$ac_cv_func_arc4random" = xyes; then :
index daa521ceb421882b1e93d32f64f219974f2e67bf..b939b2945ef18b83a6d268b7b969ce6e95047296 100644 (file)
@@ -801,7 +801,7 @@ if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/
        AC_DEFINE([HAVE_LIBRESSL], [1], [Define if we have LibreSSL])
        # libressl provides these compat functions, but they may also be
        # declared by the OS in libc.  See if they have been declared.
-       AC_CHECK_DECLS([strlcpy,strlcat,arc4random,arc4random_uniform,reallocarray])
+       AC_CHECK_DECLS([strlcpy,strlcat,arc4random,arc4random_uniform])
 else
        AC_MSG_RESULT([no])
 fi
@@ -1483,6 +1483,7 @@ int main(void) {
        AC_MSG_RESULT(no)
        AC_LIBOBJ(reallocarray)
 ])
+AC_CHECK_DECLS([reallocarray])
 if test "$USE_NSS" = "no"; then
        AC_REPLACE_FUNCS(arc4random)
        AC_REPLACE_FUNCS(arc4random_uniform)
@@ -1877,6 +1878,10 @@ struct tm;
 char *strptime(const char *s, const char *format, struct tm *tm);
 #endif
 
+#if !HAVE_DECL_REALLOCARRAY
+void *reallocarray(void *ptr, size_t nmemb, size_t size);
+#endif
+
 #ifdef HAVE_LIBRESSL
 #  if !HAVE_DECL_STRLCPY
 size_t strlcpy(char *dst, const char *src, size_t siz);
@@ -1890,9 +1895,6 @@ uint32_t arc4random(void);
 #  if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
 uint32_t arc4random_uniform(uint32_t upper_bound);
 #  endif
-#  if !HAVE_DECL_REALLOCARRAY
-void *reallocarray(void *ptr, size_t nmemb, size_t size);
-#  endif
 #endif /* HAVE_LIBRESSL */
 #ifndef HAVE_ARC4RANDOM
 int getentropy(void* buf, size_t len);
index 22f1aaa730d0394f52619632084cacf411d2d273..8c7562dabfd0cf3a62dcd0a5cf790ba7cbb7044a 100644 (file)
@@ -4,6 +4,7 @@
          systemd unbound.service.
        - oss-fuzz badge on README.md.
        - Fix fix for #78 to also free service callback struct.
+       - Fix for oss-fuzz build warning.
 
 11 September 2019: Wouter
        - Use explicit bzero for wiping clear buffer of hash in cachedb,