summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-09 21:21:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-09 21:21:58 +0000
commitf6dbc1b38f6ec140a2bba54729ea5f6ad24b22f6 (patch)
tree312be7edd79040fb01e9d80dff61893347aa6135 /sbin
parentdef5840f0aab79c220dfcf0affe9d3c6907c3230 (diff)
off by one in carp configuration; found by parfait, ok jsg
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index cc8888c5e93..2d67c63b398 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.223 2009/11/22 22:00:24 claudio Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.224 2009/12/09 21:21:57 deraadt Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -3641,7 +3641,8 @@ setcarp_nodes(const char *val, int d)
str = strtok(optlist, ",");
for (i = 0; str != NULL; i++) {
u_int vhid, advskew;
- if (i > CARP_MAXNODES)
+
+ if (i >= CARP_MAXNODES)
errx(1, "too many carp nodes");
if (sscanf(str, "%u:%u", &vhid, &advskew) != 2) {
errx(1, "non parsable arg: %s", str);