hotfix: fixes possible out of bounds access in ospaths.joinPath
This commit is contained in:
parent
352b8a4844
commit
8667899d53
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ proc joinPath*(head, tail: string): string {.
|
||||||
if len(head) == 0:
|
if len(head) == 0:
|
||||||
result = tail
|
result = tail
|
||||||
elif head[len(head)-1] in {DirSep, AltSep}:
|
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)
|
result = head & substr(tail, 1)
|
||||||
else:
|
else:
|
||||||
result = head & tail
|
result = head & tail
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue