Don't SEGV when Hash_Table is uninitialized

This commit is contained in:
Simon J. Gerraty 2013-11-14 00:29:48 +00:00
parent 4ec38eb510
commit bc49bb2062
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258114

View File

@ -221,6 +221,9 @@ Hash_FindEntry(Hash_Table *t, const char *key)
unsigned h;
const char *p;
if (t == NULL || t->bucketPtr == NULL) {
return NULL;
}
for (h = 0, p = key; *p;)
h = (h << 5) - h + *p++;
p = key;