From 8667899d531225e060db3effe72627b9609017ce Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 7 Jul 2018 02:31:43 +0200 Subject: [PATCH] hotfix: fixes possible out of bounds access in ospaths.joinPath --- lib/pure/ospaths.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim index 96996bba7c..305052e419 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