forked from osmocom/wireshark
Fix rare case of wmem map being O(n)
For 'x' equal to 0, HASH() macro also returns 0 which makes wmem map O(n). When random generator will return 0 just use 1. Change-Id: If484091352a719aea27135a705d37ff4c184a13b Reviewed-on: https://code.wireshark.org/review/1387 Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
4272cb8786
commit
98ed927290
|
@ -36,6 +36,8 @@ void
|
|||
wmem_init_hashing(void)
|
||||
{
|
||||
x = g_random_int();
|
||||
if (G_UNLIKELY(x == 0))
|
||||
x = 1;
|
||||
|
||||
preseed = g_random_int();
|
||||
postseed = g_random_int();
|
||||
|
|
Loading…
Reference in New Issue