From owner-svn-src-all@FreeBSD.ORG Wed Aug 15 09:18:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7F561065689; Wed, 15 Aug 2012 09:18:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 641FB8FC1A; Wed, 15 Aug 2012 09:18:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7F9IoP3031383; Wed, 15 Aug 2012 09:18:50 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7F9IoTl031381; Wed, 15 Aug 2012 09:18:50 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201208150918.q7F9IoTl031381@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 15 Aug 2012 09:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239292 - head/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2012 09:18:51 -0000 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)