Date: Fri, 28 Apr 2017 14:48:29 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317556 - stable/11/sbin/mount Message-ID: <201704281448.v3SEmT0N000180@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Fri Apr 28 14:48:29 2017 New Revision: 317556 URL: https://svnweb.freebsd.org/changeset/base/317556 Log: MFC r316611: sbin/mount: strcpy -> strlcpy Reported by: Coverity CID: 1011173, 1011174 Sponsored by: Spectra Logic Corp Modified: stable/11/sbin/mount/mount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mount/mount.c ============================================================================== --- stable/11/sbin/mount/mount.c Fri Apr 28 14:45:03 2017 (r317555) +++ stable/11/sbin/mount/mount.c Fri Apr 28 14:48:29 2017 (r317556) @@ -597,7 +597,7 @@ mountfs(const char *vfstype, const char 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704281448.v3SEmT0N000180>