diff options
author | asomers <asomers@FreeBSD.org> | 2017-04-28 14:48:29 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2017-04-28 14:48:29 +0000 |
commit | fa074dda32dab51cace8f8a06d00192dd8dcfdaa (patch) | |
tree | 5bc373e5701516432afd9499c6220af2818ba2fa /sbin/mount | |
parent | b3b1b797011f52efb93e05eb5089df6e53c2277a (diff) | |
download | FreeBSD-src-fa074dda32dab51cace8f8a06d00192dd8dcfdaa.zip FreeBSD-src-fa074dda32dab51cace8f8a06d00192dd8dcfdaa.tar.gz |
MFC r316611:
sbin/mount: strcpy -> strlcpy
Reported by: Coverity
CID: 1011173, 1011174
Sponsored by: Spectra Logic Corp
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index debe354..c72570d 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)); @@ -905,8 +905,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); |