From 0c56eca43a84a48806d5d5f5316c4643337d916f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 11 Sep 2008 18:05:32 +0000 Subject: [PATCH] DEVEL15-windows-cell-list-validation-20080911 LICENSE MIT correct cell list validation now that the free cell list exists (cherry picked from commit d85bdb4c9f9ddf7d287072a3d12e65423e551f40) --- src/WINNT/afsd/cm_cell.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index 67a4ef67f..8d8264330 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -399,10 +399,19 @@ cm_ValidateCell(void) } } + for (cellp = cm_data.freeCellsp; cellp; cellp=cellp->freeNextp, count++) { + if ( count != 0 && cellp == cm_data.freeCellsp || + count > cm_data.maxCells ) { + afsi_log("cm_ValidateCell failure: cm_data.freeCellsp infinite loop"); + fprintf(stderr, "cm_ValidateCell failure: cm_data.freeCellsp infinite loop\n"); + return -3; + } + } + if ( count != cm_data.currentCells ) { afsi_log("cm_ValidateCell failure: count != cm_data.currentCells"); fprintf(stderr, "cm_ValidateCell failure: count != cm_data.currentCells\n"); - return -3; + return -4; } return 0; -- 2.39.5