From: Wilfried Göesgens Date: Sun, 9 Mar 2008 22:03:20 +0000 (+0000) Subject: * don't search for null-lengthened strings. X-Git-Tag: v7.86~2437 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5af5117d9aa5765da193a4966ac6108708f6edfe * don't search for null-lengthened strings. --- diff --git a/libcitadel/lib/hash.c b/libcitadel/lib/hash.c index 50c3e8d7a..4443552b9 100644 --- a/libcitadel/lib/hash.c +++ b/libcitadel/lib/hash.c @@ -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);