Introduce a new utility function smemclr(), which memsets things to
[sgt/putty] / windows / winmisc.c
index f54e8a4..2166f45 100644 (file)
@@ -68,6 +68,14 @@ Filename *filename_deserialise(void *vdata, int maxsize, int *used)
     return filename_from_str(data);
 }
 
+/*
+ * Windows implementation of smemclr (see misc.c) using SecureZeroMemory.
+ */
+void smemclr(void *b, size_t n) {
+    if (b && n > 0)
+        SecureZeroMemory(b, n);
+}
+
 char *get_username(void)
 {
     DWORD namelen;