Ensure buffer is nul-terminated.

MFC after:	2 weeks
This commit is contained in:
Xin LI 2018-12-31 03:08:01 +00:00
parent 1cc7e361a6
commit 1e4da04f06

View File

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