mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
Fix 32 bit overflow issue in FspFsvolReadCached.
FspFsvolReadCached takes care not to read beyond the end of the file. However, the offset check uses a 32 bit comparison, which fails for files >= 4G. As a result, reads on a large file will skip blocks at offset (filesize % 4G), and those blocks will zero-filled.
This commit is contained in:
parent
d2de5e996c
commit
b350dffe6c
@ -150,7 +150,7 @@ static NTSTATUS FspFsvolReadCached(
|
||||
FspFileNodeRelease(FileNode, Main);
|
||||
return STATUS_END_OF_FILE;
|
||||
}
|
||||
if (ReadLength > (ULONG)(FileInfo.FileSize - ReadOffset.QuadPart))
|
||||
if ((UINT64)ReadLength > FileInfo.FileSize - ReadOffset.QuadPart)
|
||||
ReadLength = (ULONG)(FileInfo.FileSize - ReadOffset.QuadPart);
|
||||
|
||||
/* initialize cache if not already initialized! */
|
||||
|
Loading…
x
Reference in New Issue
Block a user