Skip to content

Commit 27e150e

Browse files
committed
shlib: stop copying when reaching the end of the path string
1 parent 3f6ac34 commit 27e150e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shlib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ sanitize(char *buf, const char *src, size_t size)
6161
return (NULL);
6262
}
6363
*dst++ = *src++;
64+
if (*src == '\0')
65+
break;
6466
size--;
6567
}
6668
if (*src != '\0') {

0 commit comments

Comments
 (0)