don't call compare function on NULL hashtable keys
This commit is contained in:
parent
6f44ab1196
commit
bfc2433320
1 changed files with 2 additions and 0 deletions
|
|
@ -147,6 +147,8 @@ void* h_hashtable_get(const HHashTable* ht, const void* key) {
|
|||
for (hte = &ht->contents[hashval & (ht->capacity - 1)];
|
||||
hte != NULL;
|
||||
hte = hte->next) {
|
||||
if (hte->key == NULL)
|
||||
continue;
|
||||
if (hte->hashval != hashval)
|
||||
continue;
|
||||
if (ht->equalFunc(key, hte->key))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue