From: Pierre Schweitzer Date: Sun, 28 Jun 2015 21:16:03 +0000 (+0000) Subject: [NTFS] X-Git-Tag: ReactOS-0.4.0~1681 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a45dcb0d075f7172f965e48c7538d92696c81e0e [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 svn path=/trunk/; revision=68309 --- diff --git a/reactos/drivers/filesystems/ntfs/fcb.c b/reactos/drivers/filesystems/ntfs/fcb.c index de4c5f9e0a3..8d36f14df9b 100644 --- a/reactos/drivers/filesystems/ntfs/fcb.c +++ b/reactos/drivers/filesystems/ntfs/fcb.c @@ -543,6 +543,7 @@ NtfsDirFindFile(PNTFS_VCB Vcb, 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); @@ -573,6 +574,20 @@ NtfsDirFindFile(PNTFS_VCB Vcb, 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); ExFreePoolWithTag(FileRecord, TAG_NTFS);