diff src/lib/safe-memset.h @ 804:bf38c8f30a4c HEAD

Added safe_memset() which guarantees that compiler optimizations don't optimize it away. Not that we really need to clear the passwords from memory, but won't hurt much either :)
author Timo Sirainen <tss@iki.fi>
date Wed, 18 Dec 2002 12:40:43 +0200
parents
children e4eb71ae8e96
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lib/safe-memset.h	Wed Dec 18 12:40:43 2002 +0200
@@ -0,0 +1,8 @@
+#ifndef __SAFE_MEMSET_H
+#define __SAFE_MEMSET_H
+
+/* memset() guaranteed not to get optimized away by compiler.
+   Should be used instead of memset() when clearing any sensitive data. */
+void safe_memset(void *data, int c, size_t size);
+
+#endif