summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2007-11-02 15:11:53 +0000
committerkeramida <keramida@FreeBSD.org>2007-11-02 15:11:53 +0000
commitf570dc9af64bc922f3b4d29f33f5b3c4486c663a (patch)
treef8b1da644c205526a5110ff3d6594cd5484cdd64 /usr.sbin/mtree
parentba150ecc5d21f93b337a6c70e7672d776b793d8b (diff)
downloadFreeBSD-src-f570dc9af64bc922f3b4d29f33f5b3c4486c663a.zip
FreeBSD-src-f570dc9af64bc922f3b4d29f33f5b3c4486c663a.tar.gz
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
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/mtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c
index 76f623c2..49e3e6b 100644
--- a/usr.sbin/mtree/mtree.c
+++ b/usr.sbin/mtree/mtree.c
@@ -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) {
OpenPOWER on IntegriCloud