Fix buffer overrun in glob tilde expansion
Similar to 8dda888e14
but this one
noticed by covscan: not enough space for the terminating \0.
This commit is contained in:
parent
ff3d8ac2e5
commit
fa10245c91
|
@ -314,7 +314,7 @@ glob(const char *pattern, int flags,
|
|||
else {
|
||||
char *newp;
|
||||
size_t home_len = strlen(home_dir);
|
||||
newp = (char *) alloca(home_len + dirlen);
|
||||
newp = (char *) alloca(home_len + dirlen + 1);
|
||||
mempcpy(mempcpy(newp, home_dir, home_len),
|
||||
&dirname[1], dirlen);
|
||||
dirname = newp;
|
||||
|
|
Loading…
Reference in New Issue