[FREELDR]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 14 Apr 2016 20:42:12 +0000 (20:42 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 14 Apr 2016 20:42:12 +0000 (20:42 +0000)
Cherrypick r71159

svn path=/trunk/; revision=71160

reactos/boot/freeldr/freeldr/lib/fs/ntfs.c

index e8a5745..8aa5ea4 100644 (file)
@@ -302,8 +302,8 @@ static ULONG NtfsReadAttribute(PNTFS_VOLUME_INFO Volume, PNTFS_ATTR_CONTEXT Cont
 
     ReadLength = (ULONG)min(DataRunLength * Volume->ClusterSize - (Offset - CurrentOffset), Length);
     if (DataRunStartLCN == -1)
-    RtlZeroMemory(Buffer, ReadLength);
-    if (NtfsDiskRead(Volume, DataRunStartLCN * Volume->ClusterSize + Offset - CurrentOffset, ReadLength, Buffer))
+        RtlZeroMemory(Buffer, ReadLength);
+    if (DataRunStartLCN == -1 || NtfsDiskRead(Volume, DataRunStartLCN * Volume->ClusterSize + Offset - CurrentOffset, ReadLength, Buffer))
     {
         Length -= ReadLength;
         Buffer += ReadLength;