- Timestamp:
- Dec 31, 2021 11:42:50 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/fatvfs.cpp
r93084 r93113 1216 1216 { 1217 1217 /* Validate the cluster, checking for end of file. */ 1218 if ( idxCluster >= pFatCache->cClusters 1219 || idxCluster < FAT_FIRST_DATA_CLUSTER) 1218 if ((uint32_t)(idxCluster - FAT_FIRST_DATA_CLUSTER) >= pFatCache->cClusters) 1220 1219 { 1221 1220 if (idxCluster >= FAT_FIRST_FAT12_EOC) 1222 1221 return VINF_SUCCESS; 1222 Log(("Fat/ReadChain12: bogus cluster %#x vs %#x total\n", idxCluster, pFatCache->cClusters)); 1223 1223 return VERR_VFS_BOGUS_OFFSET; 1224 1224 } … … 1265 1265 { 1266 1266 /* Validate the cluster, checking for end of file. */ 1267 if ( idxCluster >= pFatCache->cClusters 1268 || idxCluster < FAT_FIRST_DATA_CLUSTER) 1267 if ((uint32_t)(idxCluster - FAT_FIRST_DATA_CLUSTER) >= pFatCache->cClusters) 1269 1268 { 1270 1269 if (idxCluster >= FAT_FIRST_FAT16_EOC) 1271 1270 return VINF_SUCCESS; 1271 Log(("Fat/ReadChain16: bogus cluster %#x vs %#x total\n", idxCluster, pFatCache->cClusters)); 1272 1272 return VERR_VFS_BOGUS_OFFSET; 1273 1273 } … … 1297 1297 { 1298 1298 /* Validate the cluster, checking for end of file. */ 1299 if ( idxCluster >= pFatCache->cClusters 1300 || idxCluster < FAT_FIRST_DATA_CLUSTER) 1299 if ((uint32_t)(idxCluster - FAT_FIRST_DATA_CLUSTER) >= pFatCache->cClusters) 1301 1300 { 1302 1301 if (idxCluster >= FAT_FIRST_FAT32_EOC) 1303 1302 return VINF_SUCCESS; 1303 Log(("Fat/ReadChain32: bogus cluster %#x vs %#x total\n", idxCluster, pFatCache->cClusters)); 1304 1304 return VERR_VFS_BOGUS_OFFSET; 1305 1305 } … … 2598 2598 2599 2599 /** 2600 * Instantiates a new directory.2600 * Instantiates a new file. 2601 2601 * 2602 2602 * @returns IPRT status code.
Note:
See TracChangeset
for help on using the changeset viewer.