소스 검색

fixed trystrtoint checking bounds

mattias 4 년 전
부모
커밋
d72e3a0770
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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;