mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
fsck(8): Don't overrun mount device buffer
Apply a very similar fix to r299460 (fsck_ffs) to apparently duplicated code
in fsck.
Reported by: Coverity
CID: 1006789
Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
63298eb19c
commit
bcbaf9fd47
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316801
@ -172,6 +172,9 @@ getmntpt(const char *name)
|
||||
statfsp = &mntbuf[i];
|
||||
dev_name = statfsp->f_mntfromname;
|
||||
if (*dev_name != '/') {
|
||||
if (strlen(_PATH_DEV) + strlen(dev_name) + 1 >
|
||||
sizeof(statfsp->f_mntfromname))
|
||||
continue;
|
||||
strcpy(device, _PATH_DEV);
|
||||
strcat(device, dev_name);
|
||||
strcpy(statfsp->f_mntfromname, device);
|
||||
|
Loading…
Reference in New Issue
Block a user