Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2013 12:30:52 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256191 - head/usr.sbin/ctladm
Message-ID:  <201310091230.r99CUqfL056468@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed Oct  9 12:30:52 2013
New Revision: 256191
URL: http://svnweb.freebsd.org/changeset/base/256191

Log:
  Fix two off-by-ones.
  
  Coverity CID:	1087999, 1011375
  Approved by:	re (glebius)
  Sponsored by:	FreeBSD Foundation

Modified:
  head/usr.sbin/ctladm/ctladm.c

Modified: head/usr.sbin/ctladm/ctladm.c
==============================================================================
--- head/usr.sbin/ctladm/ctladm.c	Wed Oct  9 12:19:48 2013	(r256190)
+++ head/usr.sbin/ctladm/ctladm.c	Wed Oct  9 12:30:52 2013	(r256191)
@@ -3442,7 +3442,7 @@ cctl_islist_start_element(void *user_dat
 	islist = (struct cctl_islist_data *)user_data;
 	cur_conn = islist->cur_conn;
 	islist->level++;
-	if ((u_int)islist->level > (sizeof(islist->cur_sb) /
+	if ((u_int)islist->level >= (sizeof(islist->cur_sb) /
 	    sizeof(islist->cur_sb[0])))
 		errx(1, "%s: too many nesting levels, %zd max", __func__,
 		     sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]));
@@ -3848,7 +3848,7 @@ cctl_start_element(void *user_data, cons
 	devlist = (struct cctl_devlist_data *)user_data;
 	cur_lun = devlist->cur_lun;
 	devlist->level++;
-	if ((u_int)devlist->level > (sizeof(devlist->cur_sb) /
+	if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) /
 	    sizeof(devlist->cur_sb[0])))
 		errx(1, "%s: too many nesting levels, %zd max", __func__,
 		     sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));



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