From: David Carlier Date: Sat, 21 Nov 2020 12:22:23 +0000 (+0000) Subject: Using explicit_memset for the explicit_bzero compatibility layer. X-Git-Tag: V_8_5_P1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cb6ce98d658e5fbdae025a3bd65793980e3b5d9;p=thirdparty%2Fopenssh-portable.git Using explicit_memset for the explicit_bzero compatibility layer. Favoriting the native implementation in this case. --- diff --git a/configure.ac b/configure.ac index 0cd1025f6..63c239e09 100644 --- a/configure.ac +++ b/configure.ac @@ -1805,6 +1805,7 @@ AC_CHECK_FUNCS([ \ err \ errx \ explicit_bzero \ + explicit_memset \ fchmod \ fchmodat \ fchown \ diff --git a/openbsd-compat/explicit_bzero.c b/openbsd-compat/explicit_bzero.c index 6ef9825a9..68cd2c10b 100644 --- a/openbsd-compat/explicit_bzero.c +++ b/openbsd-compat/explicit_bzero.c @@ -15,7 +15,15 @@ #ifndef HAVE_EXPLICIT_BZERO -#ifdef HAVE_MEMSET_S +#ifdef HAVE_EXPLICIT_MEMSET + +void +explicit_bzero(void *p, size_t n) +{ + (void)explicit_memset(p, 0, n); +} + +#elif defined(HAVE_MEMSET_S) void explicit_bzero(void *p, size_t n)