Merge pull request #219 from dworkin/read-4g-corruption

Fix read corruption issue.
This commit is contained in:
Bill Zissimopoulos 2019-03-11 13:01:44 -07:00 committed by GitHub
commit ad866631b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -57,6 +57,7 @@ CONTRIBUTOR LIST
|Ben Rubson |ben.rubson at gmail.com |Ben Rubson |ben.rubson at gmail.com
|Bill Zissimopoulos |billziss at navimatics.com |Bill Zissimopoulos |billziss at navimatics.com
|Colin Atkinson (Atakama, https://atakama.com) |colin at atakama.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 |Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr
|Fritz Elfert |fritz-github at fritz-elfert.de |Fritz Elfert |fritz-github at fritz-elfert.de
|John Oberschelp |john at oberschelp.net |John Oberschelp |john at oberschelp.net

View File

@ -150,7 +150,7 @@ static NTSTATUS FspFsvolReadCached(
FspFileNodeRelease(FileNode, Main); FspFileNodeRelease(FileNode, Main);
return STATUS_END_OF_FILE; 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); ReadLength = (ULONG)(FileInfo.FileSize - ReadOffset.QuadPart);
/* initialize cache if not already initialized! */ /* initialize cache if not already initialized! */