mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-16 20:49:21 +02:00
* Add range check to trystrtoint
This commit is contained in:
parent
dd8c294f2b
commit
cbcc6c63b8
@ -4664,12 +4664,9 @@ Var
|
||||
|
||||
begin
|
||||
Result:=TryStrToInt(S,NI);
|
||||
Result:=Result and (-2147483648<=NI) and (NI<=2147483647);
|
||||
if Result then
|
||||
begin
|
||||
res:=NI;
|
||||
if (NI<low(res)) or (NI>high(res)) then
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user