]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dataset: fix hash computation 4333/head
authorEric Leblond <eric@regit.org>
Tue, 29 Oct 2019 09:55:59 +0000 (10:55 +0100)
committerEric Leblond <eric@regit.org>
Tue, 29 Oct 2019 09:55:59 +0000 (10:55 +0100)
src/datasets-string.c

index 29d3881f4a9b5dcf6533f6ac26e321a01feec812..3d669391a2501b9a102cf0590dfeef75804a65e6 100644 (file)
@@ -89,8 +89,9 @@ uint32_t StringHash(void *s)
 {
     uint32_t hash = 5381;
     int c;
+    uint8_t *sptr = ((StringType *)s)->ptr;
 
-    while ((c = *(char *)s++))
+    while ((c = *sptr++))
         hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
 
     return hash;