aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/shingles.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-05 12:57:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-05 12:57:58 +0100
commit2d0e4061c78be4c7d1fc713a7e2f199f26134658 (patch)
treeeb68a54f825e13e7e1652820a37a7fe8fefeedc6 /src/libutil/shingles.c
parent39fec823f124a82dd6a4bcd06a53a0ff062f4ac0 (diff)
downloadrspamd-2d0e4061c78be4c7d1fc713a7e2f199f26134658.tar.gz
rspamd-2d0e4061c78be4c7d1fc713a7e2f199f26134658.zip
[Minor] Fix couple of warnings and disable -pedantic mode
Diffstat (limited to 'src/libutil/shingles.c')
-rw-r--r--src/libutil/shingles.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c
index 66f6b457c..0f35a07e0 100644
--- a/src/libutil/shingles.c
+++ b/src/libutil/shingles.c
@@ -99,7 +99,7 @@ rspamd_shingles_generate (GArray *input,
}
}
else {
- guint64 res[SHINGLES_WINDOW * RSPAMD_SHINGLE_SIZE];
+ guint64 res[SHINGLES_WINDOW * RSPAMD_SHINGLE_SIZE], seed;
switch (alg) {
case RSPAMD_SHINGLES_XXHASH:
@@ -127,13 +127,15 @@ rspamd_shingles_generate (GArray *input,
word = &g_array_index (input, rspamd_ftok_t, beg);
/* Insert the last element to the pipe */
+ memcpy (&seed, keys[j], sizeof (seed));
res[j * SHINGLES_WINDOW + SHINGLES_WINDOW - 1] =
rspamd_cryptobox_fast_hash_specific (ht,
word->begin, word->len,
- *(guint64 *)keys[j]);
+ seed);
val = 0;
for (k = 0; k < SHINGLES_WINDOW; k ++) {
- val ^= res[j * SHINGLES_WINDOW + k] >> (8 * (SHINGLES_WINDOW - k - 1));
+ val ^= res[j * SHINGLES_WINDOW + k] >>
+ (8 * (SHINGLES_WINDOW - k - 1));
}
g_assert (hlen > beg);