]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-btree-enum-20080723
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 23 Jul 2008 22:20:45 +0000 (22:20 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 23 Jul 2008 22:20:45 +0000 (22:20 +0000)
LICENSE MIT

Fix next enum to return an invalid param error when beyond the end
of the list.

(cherry picked from commit a9c00f2638d44e1d077fbd953bf153df9cc319c4)

src/WINNT/afsd/cm_btree.c

index e9018b0250fc540b2f7e8cef02a488440a1ce0be..93a2e47fc1115706fe4f55b94402b7010b74467a 100644 (file)
@@ -2336,11 +2336,11 @@ cm_BPlusDirEnumBulkStat(cm_scache_t *dscp, cm_direnum_t *enump, cm_user_t *userp
 long 
 cm_BPlusDirNextEnumEntry(cm_direnum_t *enump, cm_direnum_entry_t **entrypp)
 {      
-    if (enump == NULL || entrypp == NULL || enump->next > enump->count) {
+    if (enump == NULL || entrypp == NULL || enump->next >= enump->count) {
        if (entrypp)
            *entrypp = NULL;
        osi_Log0(afsd_logp, "cm_BPlusDirNextEnumEntry invalid input");
-       return CM_ERROR_INVAL;                        \
+       return CM_ERROR_INVAL;
     }
 
     *entrypp = &enump->entry[enump->next++];