* don't search for null-lengthened strings.
authorWilfried Göesgens <willi@citadel.org>
Sun, 9 Mar 2008 22:03:20 +0000 (22:03 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 9 Mar 2008 22:03:20 +0000 (22:03 +0000)
libcitadel/lib/hash.c

index 50c3e8d7a5de63b2dfd82ccf001e30e2b77344e1..4443552b9ad66b6e3dd4e42bcb06c779270b851f 100644 (file)
@@ -378,6 +378,10 @@ int GetHash(HashList *Hash, const char *HKey, long HKLen, void **Data)
        long HashBinKey;
        long HashAt;
 
+       if (HKLen <= 0) {
+               *Data = NULL;
+               return  0;
+       }
        /** first, find out were we could be... */
        HashBinKey = CalcHashKey((char*)HKey, HKLen);
        HashAt = FindInHash(Hash, HashBinKey);