Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2012 10:17:03 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231654 - head/usr.sbin/pw
Message-ID:  <201202141017.q1EAH3uh092423@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Tue Feb 14 10:17:03 2012
New Revision: 231654
URL: http://svn.freebsd.org/changeset/base/231654

Log:
  readlink len-1

Modified:
  head/usr.sbin/pw/cpdir.c

Modified: head/usr.sbin/pw/cpdir.c
==============================================================================
--- head/usr.sbin/pw/cpdir.c	Tue Feb 14 10:16:56 2012	(r231653)
+++ head/usr.sbin/pw/cpdir.c	Tue Feb 14 10:17:03 2012	(r231654)
@@ -84,7 +84,7 @@ copymkdir(char const * dir, char const *
 							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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202141017.q1EAH3uh092423>