summaryrefslogtreecommitdiff
path: root/usr.sbin/rtadvd/config.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-22 10:49:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-22 10:49:18 +0000
commitbeeeb36b16ee162ea1b5040971593dd8614eb26b (patch)
tree7a1061b0ecc4017bb5fba9ef0c4c34632ee3c1ce /usr.sbin/rtadvd/config.c
parent89c2815ec2ca406da9845d4f69753768781ca2f3 (diff)
Add additional limit check to ensure that we do not overflow pp->prefix
while masking the prefix. Fix from itojun@. OK dhartmei@
Diffstat (limited to 'usr.sbin/rtadvd/config.c')
-rw-r--r--usr.sbin/rtadvd/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index 5ad9b5457c8..3092d054986 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.22 2003/06/18 02:26:58 itojun Exp $ */
+/* $OpenBSD: config.c,v 1.23 2006/03/22 10:49:17 claudio Exp $ */
/* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */
/*
@@ -450,7 +450,7 @@ get_prefix(struct rainfo *rai)
{
p = (u_char *)&pp->prefix;
ep = (u_char *)(&pp->prefix + 1);
- while (m < lim)
+ while (m < lim && p < ep)
*p++ &= *m++;
while (p < ep)
*p++ = 0x00;