mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[NTFS]
Don't attempt to read beyond stream size. Patch by Trevor Thompson. CORE-11707 svn path=/trunk/; revision=72067
This commit is contained in:
parent
96fe018e77
commit
21652b5c7f
1 changed files with 4 additions and 1 deletions
|
@ -147,7 +147,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
RealLength = ROUND_UP(ToRead, DeviceExt->NtfsInfo.BytesPerSector);
|
RealLength = ROUND_UP(ToRead, DeviceExt->NtfsInfo.BytesPerSector);
|
||||||
/* do we need to extend RealLength by one sector? */
|
/* do we need to extend RealLength by one sector? */
|
||||||
if (RealLength + RealReadOffset < ReadOffset + Length)
|
if (RealLength + RealReadOffset < ReadOffset + Length)
|
||||||
RealLength += DeviceExt->NtfsInfo.BytesPerSector;
|
{
|
||||||
|
if (RealReadOffset + RealLength + DeviceExt->NtfsInfo.BytesPerSector <= AttributeAllocatedLength(&DataContext->Record))
|
||||||
|
RealLength += DeviceExt->NtfsInfo.BytesPerSector;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength, TAG_NTFS);
|
ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength, TAG_NTFS);
|
||||||
|
|
Loading…
Reference in a new issue