소스 검색

* fixed range check error in HasDriveLetter when path is 1 character long

Nikolay Nikolov 4 년 전
부모
커밋
fe903f2ae4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      rtl/wasi/system.pp

+ 1 - 1
rtl/wasi/system.pp

@@ -62,7 +62,7 @@ implementation
 
 function HasDriveLetter(const path: rawbytestring): Boolean;
 begin
-  HasDriveLetter:=(path<>'') and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
+  HasDriveLetter:=(Length(path)>=2) and (UpCase(path[1]) in ['A'..'Z']) and (path[2] = ':');
 end;
 
 type