Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 2016 08:51:00 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294975 - stable/10/sys/boot/zfs
Message-ID:  <201601280851.u0S8p0f2099419@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Thu Jan 28 08:51:00 2016
New Revision: 294975
URL: https://svnweb.freebsd.org/changeset/base/294975

Log:
  MFC r294040:
  
  Prevent bogus compiler in ZFS boot code.
  
  Sponsored by:	Multiplay

Modified:
  stable/10/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/zfs/zfsimpl.c
==============================================================================
--- stable/10/sys/boot/zfs/zfsimpl.c	Thu Jan 28 08:49:21 2016	(r294974)
+++ stable/10/sys/boot/zfs/zfsimpl.c	Thu Jan 28 08:51:00 2016	(r294975)
@@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount,
 				strcpy(&path[sb.st_size], p);
 			else
 				path[sb.st_size] = 0;
-			if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) {
+			/*
+			 * Second test is purely to silence bogus compiler
+			 * warning about accessing past the end of dn_bonus.
+			 */
+			if (sb.st_size + sizeof(znode_phys_t) <=
+			    dn.dn_bonuslen && sizeof(znode_phys_t) <=
+			    sizeof(dn.dn_bonus)) {
 				memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)],
 					sb.st_size);
 			} else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601280851.u0S8p0f2099419>