From bfc2433320a2af65e2e4bc39cc680f950c35a685 Mon Sep 17 00:00:00 2001
From: "Sven M. Hallberg" <pesco@khjk.org>
Date: Fri, 14 Jun 2013 17:07:56 +0200
Subject: [PATCH] don't call compare function on NULL hashtable keys

---
 src/datastructures.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/datastructures.c b/src/datastructures.c
index 55b8345e..075b966b 100644
--- a/src/datastructures.c
+++ b/src/datastructures.c
@@ -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))
-- 
GitLab