aboutsummaryrefslogtreecommitdiff
path: root/src/test/test-memwipe.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-08 09:00:24 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-08 09:00:24 -0400
commit08d1ac4f2ae81a79d19cbb830c3c88cb2998cb6e (patch)
treebc6da88be165580ebca60e277ae95be9bfdd6a09 /src/test/test-memwipe.c
parentbee5f38e39243dc229f4067b170ed355f40108cf (diff)
downloadtor-08d1ac4f2ae81a79d19cbb830c3c88cb2998cb6e.tar.gz
tor-08d1ac4f2ae81a79d19cbb830c3c88cb2998cb6e.zip
Patch from rubiate: disable openbsd memory protections in test-memwipe
Test-memwipe is *supposed* to invoke undefined behavior, alas. Closes 20066.
Diffstat (limited to 'src/test/test-memwipe.c')
-rw-r--r--src/test/test-memwipe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c
index 2d40283fb1..8187c45461 100644
--- a/src/test/test-memwipe.c
+++ b/src/test/test-memwipe.c
@@ -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)
{