gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22242 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r22242 - gnunet/src/util
Date: Sun, 24 Jun 2012 00:30:43 +0200

Author: grothoff
Date: 2012-06-24 00:30:43 +0200 (Sun, 24 Jun 2012)
New Revision: 22242

Modified:
   gnunet/src/util/common_allocation.c
Log:
-LRN: Poisoning:
  Poisons memory before freeing it. It uses msize() CRT function,
which (i believe) is not available on other platforms. This patch was
intended to make the output of the next patch (see below) more apparent.




Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2012-06-23 22:29:39 UTC (rev 22241)
+++ gnunet/src/util/common_allocation.c 2012-06-23 22:30:43 UTC (rev 22242)
@@ -198,6 +198,17 @@
   ptr = &((size_t *) ptr)[-1];
   mem_used -= *((size_t *) ptr);
 #endif
+#if WINDOWS
+#if ENABLE_POISONING
+  {
+    size_t i;
+    char baadfood[4] = "\xBA\xAD\xF0\x0D";
+    size_t s = _msize (ptr);
+    for (i = 0; i < s; i++)
+      ((char *) ptr)[i] = baadfood[i % 4];
+  }
+#endif
+#endif
   free (ptr);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]