priv: Fix explicit_bzero macro if we pass a function

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-02-22 07:37:10 +01:00
parent 0c12643466
commit bba40abc76

View File

@@ -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 */