mirror of
https://github.com/reactos/reactos.git
synced 2025-06-14 23:29:50 +00:00
[NTOS:CC] Don't read past the end of the file in CcPerformReadAhead.
This commit is contained in:
parent
56e2bf2f92
commit
a2f77ee3fb
1 changed files with 10 additions and 0 deletions
|
@ -517,6 +517,16 @@ CcPerformReadAhead(
|
||||||
/* Remember it's locked */
|
/* Remember it's locked */
|
||||||
Locked = TRUE;
|
Locked = TRUE;
|
||||||
|
|
||||||
|
/* Don't read past the end of the file */
|
||||||
|
if (CurrentOffset >= SharedCacheMap->FileSize.QuadPart)
|
||||||
|
{
|
||||||
|
goto Clear;
|
||||||
|
}
|
||||||
|
if (CurrentOffset + Length > SharedCacheMap->FileSize.QuadPart)
|
||||||
|
{
|
||||||
|
Length = SharedCacheMap->FileSize.QuadPart - CurrentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
/* Next of the algorithm will lock like CcCopyData with the slight
|
/* Next of the algorithm will lock like CcCopyData with the slight
|
||||||
* difference that we don't copy data back to an user-backed buffer
|
* difference that we don't copy data back to an user-backed buffer
|
||||||
* We just bring data into Cc
|
* We just bring data into Cc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue