svn commit: r342640 - head/lib/libutil

Xin LI delphij at FreeBSD.org
Mon Dec 31 03:08:02 UTC 2018


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]);


More information about the svn-src-all mailing list