]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix minor compile warning
authorVictor Julien <vjulien@oisf.net>
Fri, 21 Jul 2023 08:32:07 +0000 (10:32 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 25 Jul 2023 13:09:33 +0000 (15:09 +0200)
      detect-engine.c: In function ‘DetectKeywordCtxHashFunc’:
detect-engine.c:3550:75: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 3550 |     uint64_t hash = StringHashDjb2((const uint8_t *)name, strlen(name)) + (uint64_t)ctx->data;
      |

src/detect-engine.c

index 141b48a902ebc4dd515ab1b1bf229d577d19cfe9..4ec6d9a2840ec35cc5f32d58d863d78f86136912 100644 (file)
@@ -3547,7 +3547,7 @@ static uint32_t DetectKeywordCtxHashFunc(HashListTable *ht, void *data, uint16_t
 {
     DetectEngineThreadKeywordCtxItem *ctx = data;
     const char *name = ctx->name;
-    uint64_t hash = StringHashDjb2((const uint8_t *)name, strlen(name)) + (uint64_t)ctx->data;
+    uint64_t hash = StringHashDjb2((const uint8_t *)name, strlen(name)) + (ptrdiff_t)ctx->data;
     hash %= ht->array_size;
     return hash;
 }