Skip to content
Permalink
Browse files Browse the repository at this point in the history
checkpath: fix allocation size of path buffer
strlen's return value isn't enough to be used
directly for (x)malloc; it doesn't include
the null byte at the end of the string.

X-Gentoo-Bug: 816900
X-Gentoo-Bug-URL: https://bugs.gentoo.org/816900
Fixes: #459
Fixes: #462
  • Loading branch information
thesamesam authored and williamh committed Oct 8, 2021
1 parent 6b9a5b8 commit bb83341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rc/checkpath.c
Expand Up @@ -151,7 +151,7 @@ static char *clean_path(char *path)
char *ch;
char *ch2;
char *str;
str = xmalloc(strlen(path));
str = xmalloc(strlen(path) + 1);
ch = path;
ch2 = str;
while (true) {
Expand Down

0 comments on commit bb83341

Please sign in to comment.