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
This commit is contained in:
parent
6b9a5b8271
commit
bb8334104b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user