Ensure buffer is nul-terminated.

MFC after:	2 weeks
This commit is contained in:
delphij 2018-12-31 03:08:01 +00:00
parent 17962d0222
commit 1e3059d959

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