mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 09:12:44 +00:00
MFC r299581
Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189
This commit is contained in:
parent
7fab3432b6
commit
9984c2ebf9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=300272
@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotatype, int openflags)
|
||||
return (NULL);
|
||||
qf->fd = -1;
|
||||
qf->quotatype = quotatype;
|
||||
strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname));
|
||||
strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname));
|
||||
if (stat(qf->fsname, &st) != 0)
|
||||
goto error;
|
||||
qf->dev = st.st_dev;
|
||||
|
Loading…
Reference in New Issue
Block a user