Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2018 03:08:01 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342640 - head/lib/libutil
Message-ID:  <201812310308.wBV381ep013159@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Dec 31 03:08:01 2018
New Revision: 342640
URL: https://svnweb.freebsd.org/changeset/base/342640

Log:
  Ensure buffer is nul-terminated.
  
  MFC after:	2 weeks

Modified:
  head/lib/libutil/quotafile.c

Modified: head/lib/libutil/quotafile.c
==============================================================================
--- head/lib/libutil/quotafile.c	Mon Dec 31 01:09:23 2018	(r342639)
+++ head/lib/libutil/quotafile.c	Mon Dec 31 03:08:01 2018	(r342640)
@@ -103,7 +103,7 @@ hasquota(struct fstab *fs, int type, char *qfnamep, in
 		return (0);
 	}
 	if (cp) {
-		strncpy(qfnamep, cp, qfbufsize);
+		strlcpy(qfnamep, cp, qfbufsize);
 	} else {
 		(void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file,
 		    QUOTAFILENAME, qfextension[type]);



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