aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-12 18:35:59 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-12 18:35:59 +0100
commit80cb19900c3ab36faf92060ea639bccdcda5eaa9 (patch)
tree8158c05411a9ff538535ee50b47454214a644170 /src/libutil/str_util.c
parent74b182e0166abe108a374495079c2e23cdaceac6 (diff)
downloadrspamd-80cb19900c3ab36faf92060ea639bccdcda5eaa9.tar.gz
rspamd-80cb19900c3ab36faf92060ea639bccdcda5eaa9.zip
[Minor] Fix some ubsan related issues
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 962ed1871..1f2c4629f 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -255,7 +255,7 @@ rspamd_strcase_hash (gconstpointer key)
len = strlen (p);
- return rspamd_icase_hash (p, len, rspamd_hash_seed ());
+ return (guint)rspamd_icase_hash (p, len, rspamd_hash_seed ());
}
guint
@@ -293,7 +293,7 @@ rspamd_ftok_icase_hash (gconstpointer key)
{
const rspamd_ftok_t *f = key;
- return rspamd_icase_hash (f->begin, f->len, rspamd_hash_seed ());
+ return (guint)rspamd_icase_hash (f->begin, f->len, rspamd_hash_seed ());
}
gboolean
@@ -791,7 +791,7 @@ while (0)
cols = 0;
while (inlen > 6) {
- n = *(guint64 *)in;
+ memcpy (&n, in, sizeof (n));
n = GUINT64_TO_BE (n);
if (str_len <= 0 || cols <= str_len - 8) {