summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-06-09 04:10:08 +0000
committerimp <imp@FreeBSD.org>1998-06-09 04:10:08 +0000
commit41a9e1ce2d103396468b07dce9965543cd39f4db (patch)
treeca543152855926f88ede31b4e3ad1547a44c5865 /usr.bin/find
parent276491a1c64f083aea60c7a82138eedcef34afd5 (diff)
downloadFreeBSD-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.c2
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;
}
OpenPOWER on IntegriCloud