From b689a807525232e6f0596d9360cb575e870300c2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 5 Jan 2022 13:51:30 +0000 Subject: [PATCH] [Minor] Use memcpy instead of unaligned access --- src/libserver/re_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index cde2e88a4..64f5f7a40 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -2391,7 +2391,7 @@ rspamd_re_cache_is_valid_hyperscan_file (struct rspamd_re_cache *cache, p = map + RSPAMD_HS_MAGIC_LEN + sizeof (test_plt); end = map + len; - n = *(gint *)p; + memcpy(&n, p, sizeof(n)); p += sizeof (gint); if (n <= 0 || 2 * n * sizeof (gint) + /* IDs + flags */ -- 2.39.5