Browse files

Fix off-by-one.

Coverity CID:	1011375
Approved by:	re (glebius)
Sponsored by:	FreeBSD Foundation
  • Loading branch information...
1 parent c054998 commit 05bb4f6fbc1f863061664e81e3d03fea7ee90f3c @trasz trasz committed Oct 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 usr.sbin/ctld/kernel.c
View
2 usr.sbin/ctld/kernel.c
@@ -135,7 +135,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr)
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]));

0 comments on commit 05bb4f6

Please sign in to comment.