mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
* Avoid overflow when reading from streams > 2gb
git-svn-id: trunk@22945 -
This commit is contained in:
parent
3a5b5f03d5
commit
a3f7a7fdb4
@ -592,8 +592,9 @@ begin
|
||||
Result:=0;
|
||||
If (FSize>0) and (FPosition<Fsize) and (FPosition>=0) then
|
||||
begin
|
||||
Result:=FSize-FPosition;
|
||||
If Result>Count then Result:=Count;
|
||||
Result:=Count;
|
||||
If (Result>(FSize-FPosition)) then
|
||||
Result:=(FSize-FPosition);
|
||||
Move ((FMemory+FPosition)^,Buffer,Result);
|
||||
FPosition:=Fposition+Result;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user