Author: tfaber
Date: Sat Mar 28 17:14:14 2015
New Revision: 66932
URL:
http://svn.reactos.org/svn/reactos?rev=66932&view=rev
Log:
[FASTFAT]
- Assert that clusters supposedly belonging to a file are not in fact marked as free
CORE-9433
Modified:
trunk/reactos/drivers/filesystems/fastfat/fat.c
Modified: trunk/reactos/drivers/filesystems/fastfat/fat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] Sat Mar 28 17:14:14 2015
@@ -49,6 +49,7 @@
if (CurrentCluster >= 0xffffff8 && CurrentCluster <= 0xfffffff)
CurrentCluster = 0xffffffff;
+ ASSERT(CurrentCluster != 0);
CcUnpinData(Context);
*NextCluster = CurrentCluster;
return STATUS_SUCCESS;
@@ -80,6 +81,7 @@
CurrentCluster = *((PUSHORT)((char*)BaseAddress + (FATOffset % ChunkSize)));
if (CurrentCluster >= 0xfff8 && CurrentCluster <= 0xffff)
CurrentCluster = 0xffffffff;
+ ASSERT(CurrentCluster != 0);
CcUnpinData(Context);
*NextCluster = CurrentCluster;
return STATUS_SUCCESS;
@@ -123,6 +125,7 @@
Entry = 0xffffffff;
// DPRINT("Returning %x\n",Entry);
+ ASSERT(Entry != 0);
*NextCluster = Entry;
CcUnpinData(Context);
// return Entry == 0xffffffff ? STATUS_END_OF_FILE : STATUS_SUCCESS;
@@ -667,7 +670,10 @@
DeviceExt, CurrentCluster);
if (CurrentCluster == 0)
+ {
+ ASSERT(CurrentCluster != 0);
return STATUS_INVALID_PARAMETER;
+ }
ExAcquireResourceSharedLite(&DeviceExt->FatResource, TRUE);
Status = DeviceExt->GetNextCluster(DeviceExt, CurrentCluster, NextCluster);