From 1e3059d959524f07995aefdf2c967cfa0a1c51dc Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 31 Dec 2018 03:08:01 +0000 Subject: [PATCH] Ensure buffer is nul-terminated. MFC after: 2 weeks --- lib/libutil/quotafile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libutil/quotafile.c b/lib/libutil/quotafile.c index d5ef11267df3..b460c5d1453e 100644 --- a/lib/libutil/quotafile.c +++ b/lib/libutil/quotafile.c @@ -103,7 +103,7 @@ hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize) 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]);