]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect port: fix integer handling in hashing
authorVictor Julien <victor@inliniac.net>
Fri, 6 May 2016 11:06:15 +0000 (13:06 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 9 May 2016 18:31:35 +0000 (20:31 +0200)
src/detect-engine-port.c

index 59fd2d08f444595f23d935010edb0af457a13d01..d545dc16d377344b9e5f3f95bb46eab01f791ddd 100644 (file)
@@ -1487,7 +1487,7 @@ static uint32_t DetectPortHashFunc(HashListTable *ht, void *data, uint16_t datal
 
     SCLogDebug("hashing sgh %p", p);
 
-    hash = (p->port << 16) | p->port2;
+    hash = ((uint32_t)p->port << 16) | p->port2;
 
     hash %= ht->array_size;
     SCLogDebug("hash %"PRIu32, hash);