Author: pschweitzer
Date: Sun Jun 28 21:16:03 2015
New Revision: 68309
URL:
http://svn.reactos.org/svn/reactos?rev=68309&view=rev
Log:
[NTFS]
Validate the stream we're trying to open properly exists.
This check might have to be moved later on when the driver switches to RW
Modified:
trunk/reactos/drivers/filesystems/ntfs/fcb.c
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sun Jun 28 21:16:03 2015
@@ -543,6 +543,7 @@
PFILE_RECORD_HEADER FileRecord;
ULONGLONG MFTIndex;
PWSTR Colon;
+ PNTFS_ATTR_CONTEXT DataContext;
USHORT Length = 0;
DPRINT1("NtfsDirFindFile(%p, %p, %S, %p)\n", Vcb, DirectoryFcb, FileToFind,
FoundFCB);
@@ -571,6 +572,20 @@
if (Length != 0)
{
File.Length = Length;
+ }
+
+ if ((FileRecord->Flags & FRH_DIRECTORY) && Colon != 0)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+ else if (Colon != 0)
+ {
+ Status = FindAttribute(Vcb, FileRecord, AttributeData, Colon, wcslen(Colon),
&DataContext);
+ if (!NT_SUCCESS(Status))
+ {
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
+ ReleaseAttributeContext(DataContext);
}
Status = NtfsMakeFCBFromDirEntry(Vcb, DirectoryFcb, &File, Colon, FileRecord,
MFTIndex, FoundFCB);