diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-02-22 07:37:10 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-02-22 16:28:24 +0100 |
commit | bba40abc7603fbb3e4f5089684845312b789aff7 (patch) | |
tree | 9fa1d6ec7c38be309c81efb6fa5c3a790adceaff | |
parent | 0c126434660b6f269ac68f4b133a29c639807043 (diff) | |
download | libssh-bba40abc7603fbb3e4f5089684845312b789aff7.tar.gz libssh-bba40abc7603fbb3e4f5089684845312b789aff7.tar.xz libssh-bba40abc7603fbb3e4f5089684845312b789aff7.zip |
priv: Fix explicit_bzero macro if we pass a function
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | include/libssh/priv.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |