浏览代码

* 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