mtree should use getcwd() instead of getwd(). getcwd() is safer,
because it includes checks for the length of the buffer it uses. Reviewed by: phk, cperciva MFC after: 3 days
This commit is contained in:
parent
e56fbc5aad
commit
1d916e2c71
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173282
@ -164,7 +164,7 @@ main(int argc, char *argv[])
|
||||
if (dir && chdir(dir))
|
||||
err(1, "%s", dir);
|
||||
|
||||
if ((cflag || sflag) && !getwd(fullpath))
|
||||
if ((cflag || sflag) && !getcwd(fullpath, sizeof(fullpath)))
|
||||
errx(1, "%s", fullpath);
|
||||
|
||||
if (cflag) {
|
||||
|
Loading…
Reference in New Issue
Block a user