aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/mount
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2017-04-07 15:39:41 +0000
committerAlan Somers <asomers@FreeBSD.org>2017-04-07 15:39:41 +0000
commit6e24000a7274716f2aee78362f323ddfd8e95b7b (patch)
treeccb26fcb711af106f27382360603cd9cf51889ac /sbin/mount
parent2b8aaacea9d03f77f23997bb63a6951e762a9948 (diff)
downloadsrc-6e24000a7274716f2aee78362f323ddfd8e95b7b.tar.gz
src-6e24000a7274716f2aee78362f323ddfd8e95b7b.zip
sbin/mount: strcpy -> strlcpy
Reported by: Coverity CID: 1011173, 1011174 MFC after: 3 weeks Sponsored by: Spectra Logic Corp
Notes
Notes: svn path=/head/; revision=316611
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 374e32a9aa5a..0cd2f860548d 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -597,7 +597,7 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags,
append_arg(&mnt_argv, execname);
mangle(optbuf, &mnt_argv);
if (mountprog != NULL)
- strcpy(execname, mountprog);
+ strlcpy(execname, mountprog, sizeof(execname));
append_arg(&mnt_argv, strdup(spec));
append_arg(&mnt_argv, strdup(name));
@@ -902,8 +902,9 @@ putfsent(struct statfs *ent)
if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
- strcpy(ent->f_mntfromname, (strnstr(ent->f_mntfromname, ":", 8)
- +1));
+ strlcpy(ent->f_mntfromname,
+ (strnstr(ent->f_mntfromname, ":", 8) +1),
+ sizeof(ent->f_mntfromname));
}
l = strlen(ent->f_mntfromname);