From a9c00f2638d44e1d077fbd953bf153df9cc319c4 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 23 Jul 2008 22:19:19 +0000 Subject: [PATCH] windows-btree-enum-20080723 LICENSE MIT Fix next enum to return an invalid param error when beyond the end of the list. --- src/WINNT/afsd/cm_btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/cm_btree.c b/src/WINNT/afsd/cm_btree.c index a212df8b66..c7bc2b7e75 100644 --- a/src/WINNT/afsd/cm_btree.c +++ b/src/WINNT/afsd/cm_btree.c @@ -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++];