diff options
author | imp <imp@FreeBSD.org> | 1998-06-09 04:10:08 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1998-06-09 04:10:08 +0000 |
commit | 41a9e1ce2d103396468b07dce9965543cd39f4db (patch) | |
tree | ca543152855926f88ede31b4e3ad1547a44c5865 /usr.bin/find | |
parent | 276491a1c64f083aea60c7a82138eedcef34afd5 (diff) | |
download | FreeBSD-src-41a9e1ce2d103396468b07dce9965543cd39f4db.zip FreeBSD-src-41a9e1ce2d103396468b07dce9965543cd39f4db.tar.gz |
Make sure we pass the length - 1 to readlink, since it adds its own
NUL at the end of the path.
Inspired by: OpenBSD's changes in this area by theo de raadt
Diffstat (limited to 'usr.bin/find')
-rw-r--r-- | usr.bin/find/ls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index 29c068d..a1b9dd7 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -107,7 +107,7 @@ printlink(name) int lnklen; char path[MAXPATHLEN + 1]; - if ((lnklen = readlink(name, path, MAXPATHLEN)) == -1) { + if ((lnklen = readlink(name, path, MAXPATHLEN - 1)) == -1) { warn("%s", name); return; } |