Explorar o código

fixed trystrtoint checking bounds

mattias %!s(int64=4) %!d(string=hai) anos
pai
achega
d72e3a0770
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      packages/rtl/sysutils.pas

+ 4 - 0
packages/rtl/sysutils.pas

@@ -4403,7 +4403,11 @@ Var
 begin
   Result:=TryStrToInt(S,NI);
   if Result then
+    begin
     res:=NI;
+    if (NI<low(res)) or (NI>high(res)) then
+      Result:=false;
+    end;
 end;
 
 function TryStrToInt(const S: String; out res: NativeInt): Boolean;