From: Victor Julien Date: Fri, 6 May 2016 11:06:15 +0000 (+0200) Subject: detect port: fix integer handling in hashing X-Git-Tag: suricata-3.1RC1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9235dd498f6e4a14d09dc63f2b0b721636788498;p=thirdparty%2Fsuricata.git detect port: fix integer handling in hashing --- diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index 59fd2d08f4..d545dc16d3 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -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);