From: Wilfried Göesgens Date: Sat, 20 Dec 2008 23:50:08 +0000 (+0000) Subject: * handle negative index condition X-Git-Tag: v7.86~1688 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;ds=sidebyside;h=d47def82770af4b7c74a0843d4a93863768692ff;p=citadel.git * handle negative index condition --- diff --git a/libcitadel/lib/hash.c b/libcitadel/lib/hash.c index b3c75795b..b8ba8c346 100644 --- a/libcitadel/lib/hash.c +++ b/libcitadel/lib/hash.c @@ -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;