mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[NTFS]
Fix invalid read for data shared over two sectors Patch by Trevor Thompson CORE-10998 svn path=/trunk/; revision=71060
This commit is contained in:
parent
bc08222791
commit
60b7bdf7c8
1 changed files with 5 additions and 1 deletions
|
@ -145,8 +145,12 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
RealReadOffset = ROUND_DOWN(ReadOffset, DeviceExt->NtfsInfo.BytesPerSector);
|
||||
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;
|
||||
|
||||
ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength + DeviceExt->NtfsInfo.BytesPerSector, TAG_NTFS);
|
||||
|
||||
ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength + (DeviceExt->NtfsInfo.BytesPerSector * 2), TAG_NTFS);
|
||||
if (ReadBuffer == NULL)
|
||||
{
|
||||
DPRINT1("Not enough memory!\n");
|
||||
|
|
Loading…
Reference in a new issue