Don't SEGV when Hash_Table is uninitialized
This commit is contained in:
parent
4ec38eb510
commit
bc49bb2062
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258114
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user