From b350dffe6c7deb715458bd7a912498aacdd7b389 Mon Sep 17 00:00:00 2001 From: "Felix A. Croes" Date: Thu, 7 Mar 2019 09:45:42 +0100 Subject: [PATCH 1/2] 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. --- src/sys/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/read.c b/src/sys/read.c index 8410d9d4..697c72ad 100644 --- a/src/sys/read.c +++ b/src/sys/read.c @@ -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! */ From 4cdc8b4d9c87aafd7809b6614b2b4253818ac212 Mon Sep 17 00:00:00 2001 From: "Felix A. Croes" Date: Thu, 7 Mar 2019 09:57:49 +0100 Subject: [PATCH 2/2] Update contributor's agreement. --- Contributors.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/Contributors.asciidoc b/Contributors.asciidoc index 1ed16483..e5c34bb8 100644 --- a/Contributors.asciidoc +++ b/Contributors.asciidoc @@ -57,6 +57,7 @@ CONTRIBUTOR LIST |Ben Rubson |ben.rubson at gmail.com |Bill Zissimopoulos |billziss at navimatics.com |Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.com +|Felix Croes |felix at dworkin.nl |Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr |Fritz Elfert |fritz-github at fritz-elfert.de |John Oberschelp |john at oberschelp.net