From fe903f2ae413631591528c2ea9b33fcc05eac4e3 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Tue, 12 Oct 2021 01:42:20 +0300 Subject: [PATCH] * fixed range check error in HasDriveLetter when path is 1 character long --- rtl/wasi/system.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/wasi/system.pp b/rtl/wasi/system.pp index 75b2bbf974..75ee08f7bc 100644 --- a/rtl/wasi/system.pp +++ b/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