windows-btree-enum-20080723

LICENSE MIT

Fix next enum to return an invalid param error when beyond the end
of the list.
This commit is contained in:
Jeffrey Altman 2008-07-23 22:19:19 +00:00
parent 2ed0ee573c
commit a9c00f2638

View 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++];