aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/misc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index 9ef31184..ac3a623c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1052,6 +1052,17 @@ int ssh_match_group(const char *group, const char *object)
return 0;
}
+#if !defined(HAVE_EXPLICIT_BZERO)
+void explicit_bzero(void *s, size_t n)
+{
+ memset(s, '\0', n);
+#if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
+ /* See http://llvm.org/bugs/show_bug.cgi?id=15495 */
+ __asm__ volatile("" : : "g"(s) : "memory");
+#endif /* HAVE_GCC_VOLATILE_MEMORY_PROTECTION */
+}
+#endif /* !HAVE_EXPLICIT_BZERO */
+
/** @} */
/* vim: set ts=4 sw=4 et cindent: */