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 MFC after: 1 week
This commit is contained in:
parent
4e9e03d38e
commit
61eb4d5d8a
@ -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…
x
Reference in New Issue
Block a user