aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_cryptobox_test.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-07 12:55:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-07 12:55:29 +0100
commit1c090ffdca178ea712d6073d301e8a20b4e0d470 (patch)
tree943013a7b49be2e44b0f67b0745a0bf4dbf2fcfb /test/rspamd_cryptobox_test.c
parenta60535ed57a871366b1b192d5c9cd14a5876e2c2 (diff)
downloadrspamd-1c090ffdca178ea712d6073d301e8a20b4e0d470.tar.gz
rspamd-1c090ffdca178ea712d6073d301e8a20b4e0d470.zip
Implement unalgined tests.
Diffstat (limited to 'test/rspamd_cryptobox_test.c')
-rw-r--r--test/rspamd_cryptobox_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/rspamd_cryptobox_test.c b/test/rspamd_cryptobox_test.c
index 171ee7092..54f154d38 100644
--- a/test/rspamd_cryptobox_test.c
+++ b/test/rspamd_cryptobox_test.c
@@ -30,7 +30,7 @@
#include "ottery.h"
#include "cryptobox.h"
-static const int mapping_size = 64 * 8192;
+static const int mapping_size = 64 * 8192 + 1;
static const int max_seg = 1024;
static void *
@@ -42,6 +42,7 @@ create_mapping (int mapping_len, guchar **beg, guchar **end)
map = mmap (NULL, mapping_len + psize * 3, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_SHARED, -1, 0);
g_assert (map != 0);
+ memset (map, 0, mapping_len + psize * 3);
mprotect (map, psize, PROT_NONE);
/* Misalign pointer */
*beg = ((guchar *)map) + psize + 1;
@@ -83,7 +84,6 @@ rspamd_cryptobox_test_func (void)
ottery_rand_bytes (nonce, sizeof (nonce));
memset (mac, 0, sizeof (mac));
- memset (begin, 0, end - begin);
seg = g_slice_alloc0 (sizeof (*seg) * max_seg);
/* Test baseline */