From bba40abc7603fbb3e4f5089684845312b789aff7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 22 Feb 2018 07:37:10 +0100 Subject: [PATCH] priv: Fix explicit_bzero macro if we pass a function Signed-off-by: Andreas Schneider --- include/libssh/priv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 1a842182..d191a9f5 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -287,7 +287,8 @@ int ssh_connector_remove_event(ssh_connector connector); #if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION) #define explicit_bzero(s, n) do { \ if ((s) != NULL) { \ - memset((s), '\0', (n)); __asm__ volatile("" : : "r"(&(s)) : "memory"); \ + void *_x = (s); \ + memset((_x), '\0', (n)); __asm__ volatile("" : : "r"(&(_x)) : "memory"); \ } \ } while (0) #else /* HAVE_GCC_VOLATILE_MEMORY_PROTECTION */