aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-03 21:13:21 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-03 21:13:21 +0000
commitd8efaee9fe69c6c72ba53b038b39b41103be8620 (patch)
tree07eaaca3da38f816a997992410eb291625305ae9
parent137ab1cb787d5a5e95a2fc7d2aa86dc4ab47b9a5 (diff)
downloadrspamd-d8efaee9fe69c6c72ba53b038b39b41103be8620.tar.gz
rspamd-d8efaee9fe69c6c72ba53b038b39b41103be8620.zip
[Minor] Fix alignment issue
-rw-r--r--src/libutil/str_util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 6cee32243..2d39ccf8a 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -3569,12 +3569,15 @@ rspamd_str_has_8bit_u64 (const guchar *beg, gsize len)
guint8 orb = 0;
if (len >= 16) {
- const guchar *nextd = beg+8;
+ const guchar *nextd = beg + sizeof(guint64);
guint64 n1 = 0, n2 = 0;
do {
- n1 |= *(const guint64 *)beg;
- n2 |= *(const guint64 *)nextd;
+ guint64 t;
+ memcpy(&t, beg, sizeof(t));
+ n1 |= t;
+ memcpy(&t, nextd, sizeof(t));
+ n2 |= t;
beg += 16;
nextd += 16;
len -= 16;