diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-09 10:50:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-09 10:50:36 +0100 |
commit | d7fdd3d33782ffc5ee961e25c07e2df5aec6b53a (patch) | |
tree | 20cbbd10868d75d1339ac252bb1aa6d594769f83 /src/fuzzy_storage.c | |
parent | e0cd571a328c9d218240e8fc40a49f8efffcbc33 (diff) | |
download | rspamd-d7fdd3d33782ffc5ee961e25c07e2df5aec6b53a.tar.gz rspamd-d7fdd3d33782ffc5ee961e25c07e2df5aec6b53a.zip |
[Minor] Fix aligned access
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r-- | src/fuzzy_storage.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 732e60035..704f160f4 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -781,6 +781,7 @@ rspamd_fuzzy_check_callback (struct rspamd_fuzzy_reply *result, void *ud) gboolean encrypted = FALSE, is_shingle = FALSE; struct rspamd_fuzzy_cmd *cmd = NULL; const struct rspamd_shingle *shingle = NULL; + struct rspamd_shingle sgl_cpy; switch (session->cmd_type) { case CMD_NORMAL: @@ -788,7 +789,8 @@ rspamd_fuzzy_check_callback (struct rspamd_fuzzy_reply *result, void *ud) break; case CMD_SHINGLE: cmd = &session->cmd.shingle.basic; - shingle = &session->cmd.shingle.sgl; + memcpy (&sgl_cpy, &session->cmd.shingle.sgl, sizeof (sgl_cpy)); + shingle = &sgl_cpy; is_shingle = TRUE; break; case CMD_ENCRYPTED_NORMAL: @@ -797,7 +799,8 @@ rspamd_fuzzy_check_callback (struct rspamd_fuzzy_reply *result, void *ud) break; case CMD_ENCRYPTED_SHINGLE: cmd = &session->cmd.enc_shingle.cmd.basic; - shingle = &session->cmd.enc_shingle.cmd.sgl; + memcpy (&sgl_cpy, &session->cmd.enc_shingle.cmd.sgl, sizeof (sgl_cpy)); + shingle = &sgl_cpy; encrypted = TRUE; is_shingle = TRUE; break; |