1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity 872858: hash gen overflow false positive

Help it ignore that we use the MS 7 bits in the next part of the operation
and discard it in the first part.
This commit is contained in:
Andy Green 2025-01-16 10:34:53 +00:00
parent fce734f279
commit 5a34404b1a

View file

@ -88,7 +88,10 @@ lws_map_hash_from_key_default(const lws_map_key_t key, size_t kl)
const uint8_t *u = (const uint8_t *)key;
while (kl--)
h = ((((h << 7) | (h >> 25)) + 0xa1b2c3d4) ^ (*u++)) ^ h;
h = ((
(((h & 0x1fffffff /* coverity */ ) << 7) |
(h >> 25)) +
0xa1b2c3d4) ^ (*u++)) ^ h;
return h;
}