summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-07-07 02:31:43 +0200
committerAraq <rumpf_a@web.de>2018-07-07 02:31:43 +0200
commit8667899d531225e060db3effe72627b9609017ce (patch)
tree9f16b8074aab232777d6bd1efca245908562b324
parent352b8a4844a4211fb7381f2f0d0b9e40dcb3cc72 (diff)
downloadNim-8667899d531225e060db3effe72627b9609017ce.tar.gz
hotfix: fixes possible out of bounds access in ospaths.joinPath
-rw-r--r--lib/pure/ospaths.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim
index 96996bba7..305052e41 100644
--- a/lib/pure/ospaths.nim
+++ b/lib/pure/ospaths.nim
@@ -186,7 +186,7 @@ proc joinPath*(head, tail: string): string {.
   if len(head) == 0:
     result = tail
   elif head[len(head)-1] in {DirSep, AltSep}:
-    if tail[0] in {DirSep, AltSep}:
+    if tail.len > 0 and tail[0] in {DirSep, AltSep}:
       result = head & substr(tail, 1)
     else:
       result = head & tail