]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check for bzero and supply if needed.
authorDarren Tucker <dtucker@dtucker.net>
Sat, 24 Feb 2018 09:25:22 +0000 (20:25 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Sun, 25 Feb 2018 13:09:04 +0000 (00:09 +1100)
Since explicit_bzero uses it via an indirect it needs to be a function
not just a macro.

configure.ac
openbsd-compat/bsd-misc.c
openbsd-compat/bsd-misc.h

index e81e3eccd8363a427612db65c715a10176537918..e23540e63466f94f6fc6285a282d527c181ec036 100644 (file)
@@ -1695,6 +1695,7 @@ AC_CHECK_FUNCS([ \
        bcrypt_pbkdf \
        bindresvport_sa \
        blf_enc \
+       bzero \
        cap_rights_limit \
        clock \
        closefrom \
@@ -1800,6 +1801,8 @@ AC_CHECK_FUNCS([ \
        warn \
 ])
 
+AC_CHECK_DECLS([bzero])
+
 dnl Wide character support.
 AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])
 
index 9f6dc8af2163ba5e8d228fd3d3ad9570039ddbb0..3e8f74b72f3a09464932d597640b4175f131c06a 100644 (file)
@@ -282,3 +282,11 @@ llabs(long long j)
        return (j < 0 ? -j : j);
 }
 #endif
+
+#ifndef HAVE_BZERO
+void
+bzero(void *b, size_t n)
+{
+       (void)memset(b, 0, n);
+}
+#endif
index 2cfd5dae610d4f9a67145278350f33e1b9c7584c..bf5fad1887f695b8e3108007557552c419d5f29a 100644 (file)
@@ -133,4 +133,8 @@ void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
 long long llabs(long long);
 #endif
 
+#ifndef HAVE_DECL_BZERO
+void bzero(void *, size_t);
+#endif
+
 #endif /* _BSD_MISC_H */