Date: Wed, 9 Oct 2013 12:17:41 +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: r256189 - head/usr.sbin/ctld Message-ID: <201310091217.r99CHfRQ048940@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Wed Oct 9 12:17:40 2013 New Revision: 256189 URL: http://svnweb.freebsd.org/changeset/base/256189 Log: Fix off-by-one. Coverity CID: 1011375 Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Oct 9 12:09:01 2013 (r256188) +++ head/usr.sbin/ctld/kernel.c Wed Oct 9 12:17:40 2013 (r256189) @@ -135,7 +135,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]))) log_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?201310091217.r99CHfRQ048940>