Date: Wed, 15 Aug 2012 09:18:50 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r239292 - head/sys/boot/zfs Message-ID: <201208150918.q7F9IoTl031381@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Wed Aug 15 09:18:49 2012 New Revision: 239292 URL: http://svn.freebsd.org/changeset/base/239292 Log: Explicitly terminate the string after strncpy(3). Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Wed Aug 15 08:34:31 2012 (r239291) +++ head/sys/boot/zfs/zfs.c Wed Aug 15 09:18:49 2012 (r239292) @@ -422,6 +422,7 @@ zfs_probe_partition(void *arg, const cha ppa = (struct zfs_probe_args *)arg; strncpy(devname, ppa->devname, strlen(ppa->devname) - 1); + devname[strlen(ppa->devname) - 1] = '\0'; sprintf(devname, "%s%s:", devname, partname); pa.fd = open(devname, O_RDONLY); if (pa.fd == -1)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208150918.q7F9IoTl031381>