]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Patch from rubiate: disable openbsd memory protections in test-memwipe
authorNick Mathewson <nickm@torproject.org>
Thu, 8 Sep 2016 13:00:24 +0000 (09:00 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 8 Sep 2016 13:00:24 +0000 (09:00 -0400)
Test-memwipe is *supposed* to invoke undefined behavior, alas.

Closes 20066.

changes/ticket20066 [new file with mode: 0644]
src/test/test-memwipe.c

diff --git a/changes/ticket20066 b/changes/ticket20066
new file mode 100644 (file)
index 0000000..970793d
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor features (testing):
+    - Disable memory protections on OpenBSD when testing memwipe().
+      The test deliberately invokes undefined behaviour which the
+      protections interfere with. Patch from "rubiate". Closes ticket
+      20066.
index 2d40283fb112b9d28234610d848da76d2d124d25..8187c4546104a41816b8fddc2377162b566cfd94 100644 (file)
@@ -35,6 +35,12 @@ const char *s = NULL;
     sum += (unsigned char)buf[i];                                       \
   }
 
+#ifdef __OpenBSD__
+/* Disable some of OpenBSD's malloc protections for this test. This helps
+ * us do bad things, such as access freed buffers, without crashing. */
+const char *malloc_options="sufjj";
+#endif
+
 static unsigned
 fill_a_buffer_memset(void)
 {