windows-cell-list-validation-20080911
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 11 Sep 2008 18:03:52 +0000 (18:03 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 11 Sep 2008 18:03:52 +0000 (18:03 +0000)
LICENSE MIT

correct cell list validation now that the free cell list exists

src/WINNT/afsd/cm_cell.c

index 67a4ef6..8d82643 100644 (file)
@@ -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;