[0.4.2] * Merge the ntfs fix by Trevor in r72067. CORE-11707

svn path=/branches/ros-branch-0_4_2/; revision=72068
This commit is contained in:
Amine Khaldi 2016-08-01 08:45:49 +00:00
parent 972edc6b66
commit 9e328c22dd

View file

@ -147,7 +147,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
RealLength = ROUND_UP(ToRead, DeviceExt->NtfsInfo.BytesPerSector);
/* do we need to extend RealLength by one sector? */
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);