https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc8307205b725b661d34b…
commit bc8307205b725b661d34b9848de8c7411cc3febc
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Jan 12 16:25:34 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Jan 12 16:27:30 2019 +0100
[FASTFAT] Avoid a use after free in VfatCheckForDismount.
---
drivers/filesystems/fastfat/misc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/filesystems/fastfat/misc.c b/drivers/filesystems/fastfat/misc.c
index 2068e8b5e4..b0721230cd 100644
--- a/drivers/filesystems/fastfat/misc.c
+++ b/drivers/filesystems/fastfat/misc.c
@@ -539,12 +539,12 @@ VfatCheckForDismount(
}
if (DeviceExt->FATFileObject)
{
- Fcb = (PVFATFCB)DeviceExt->FATFileObject->FsContext;
+ Fcb = DeviceExt->FATFileObject->FsContext;
CcUninitializeCacheMap(DeviceExt->FATFileObject,
&Zero,
NULL);
- ObDereferenceObject(DeviceExt->FATFileObject);
DeviceExt->FATFileObject->FsContext = NULL;
+ ObDereferenceObject(DeviceExt->FATFileObject);
DeviceExt->FATFileObject = NULL;
vfatDestroyFCB(Fcb);
}