summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-02-14 10:17:03 +0000
committerkevlo <kevlo@FreeBSD.org>2012-02-14 10:17:03 +0000
commita6e5cd41ae1c223f22bef504edae255aea74c2e1 (patch)
tree62843b91fdf67d3c95e0e13c2c90fe4a3e783f2d
parentde1c9425fe4de9d37c143a8aa070daf6b7056b18 (diff)
downloadFreeBSD-src-a6e5cd41ae1c223f22bef504edae255aea74c2e1.zip
FreeBSD-src-a6e5cd41ae1c223f22bef504edae255aea74c2e1.tar.gz
readlink len-1
-rw-r--r--usr.sbin/pw/cpdir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c
index c5534e5..0fd671b 100644
--- a/usr.sbin/pw/cpdir.c
+++ b/usr.sbin/pw/cpdir.c
@@ -84,7 +84,7 @@ copymkdir(char const * dir, char const * skel, mode_t mode, uid_t uid, gid_t gid
if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0)
copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid);
chflags(dst, st.st_flags); /* propagate flags */
- } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) {
+ } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk) - 1)) != -1) {
lnk[len] = '\0';
symlink(lnk, dst);
lchown(dst, uid, gid);
OpenPOWER on IntegriCloud