[openssh-commits] [openssh] 01/07: Check for bzero and supply if needed.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Feb 26 00:15:43 AEDT 2018


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit a9004425a032d7a7141a5437cfabfd02431e2a74
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Sat Feb 24 20:25:22 2018 +1100

    Check for bzero and supply if needed.
    
    Since explicit_bzero uses it via an indirect it needs to be a function
    not just a macro.
---
 configure.ac              | 3 +++
 openbsd-compat/bsd-misc.c | 8 ++++++++
 openbsd-compat/bsd-misc.h | 4 ++++
 3 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index e81e3ecc..e23540e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
 
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 9f6dc8af..3e8f74b7 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -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
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 2cfd5dae..bf5fad18 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -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 */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list