* handle negative index condition
authorWilfried Göesgens <willi@citadel.org>
Sat, 20 Dec 2008 23:50:08 +0000 (23:50 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 20 Dec 2008 23:50:08 +0000 (23:50 +0000)
libcitadel/lib/hash.c

index b3c75795bd1438ac130240a054cc9df5e885b055..b8ba8c346839ac267ebcad69e39a835e8bfea0f6 100644 (file)
@@ -619,7 +619,7 @@ int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKe
 {
        long PayloadPos;
 
-       if ((Hash == NULL) || (At->Position >= Hash->nMembersUsed))
+       if ((Hash == NULL) || (At->Position >= Hash->nMembersUsed) || (At->Position < 0))
                return 0;
        *HKLen = Hash->LookupTable[At->Position]->HKLen;
        *HashKey = Hash->LookupTable[At->Position]->HashKey;