diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-10 21:36:48 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-10 21:36:48 +0000 |
commit | c70330c0f96146989bd785f685bb0199742c1a40 (patch) | |
tree | 01cb58b3d50c210a1813db9ada823f3e957d9533 /sys/netinet | |
parent | ff294b0a943dc81c4cf0a467e96b76d5442a1c4f (diff) |
Don't permit a negative index. Pointed out by Patrick Latifi.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_carp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 43dd5e92b73..a5b58ac2062 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.36 2004/03/05 12:25:56 mcbride Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.37 2004/03/10 21:36:47 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -567,7 +567,7 @@ carp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, if (namelen != 1) return (ENOTDIR); - if (name[0] == 0 || name[0] >= CARPCTL_MAXID) + if (name[0] <= 0 || name[0] >= CARPCTL_MAXID) return (ENOPROTOOPT); return sysctl_int(oldp, oldlenp, newp, newlen, &carp_opts[name[0]]); |