Browse Source

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

Nikolay Nikolov 3 years ago
parent
commit
fe903f2ae4
1 changed files with 1 additions and 1 deletions
  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