diff --git a/glib/ghash.c b/glib/ghash.c index 82b750689..e922e1a88 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -289,6 +289,9 @@ static const gint prime_mod [] = static void g_hash_table_set_shift (GHashTable *hash_table, gint shift) { + if (shift > 31) + g_error ("adding more entries to hash table would overflow"); + hash_table->size = 1 << shift; hash_table->mod = prime_mod [shift];