]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/hash.c
* off by one in range checking of indexed access
[citadel.git] / libcitadel / lib / hash.c
index ac6a377ff16ff188a62d2bfc9bea993b8ac63042..bd22f10a8f35df74d5c1a58e68c7a1e379f7ff38 100644 (file)
@@ -811,7 +811,7 @@ int GetHashAt(HashList *Hash,long At, long *HKLen, const char **HashKey, void **
 
        if ((Hash == NULL) || 
            (At < 0) || 
-           (At > Hash->nLookupTableItems))
+           (At >= Hash->nLookupTableItems))
                return 0;
        *HKLen = Hash->LookupTable[At]->HKLen;
        *HashKey = Hash->LookupTable[At]->HashKey;
@@ -955,15 +955,6 @@ void SortByPayload(HashList *Hash, CompareFunc SortBy)
  */
 
 
-/*
- * Generic function to free a pointer.  This can be used as a callback with the
- * hash table, even on systems where free() is defined as a macro or has had other
- * horrible things done to it.
- */
-void generic_free_handler(void *ptr) {
-       free(ptr);
-}
-
 /*
  * Generic function to free a reference.  
  * since a reference actualy isn't needed to be freed, do nothing.