dhcpcd-discuss

[PATCH] Remove buffer overrun that leads to a segfault on ipv6 network.

Sidney Amani

Thu Mar 22 08:41:02 2012

strcpy copies the \0 of its src argument, therefore the following line
is unneeded. Ironically, it can lead to a nasty segfault on a network
that supports ipv6. In fact, it prevented me from access such a
network using DHCP.


Signed-off-by: Sidney Amani <seed95@xxxxxxxxx>
---
 ipv6rs.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/ipv6rs.c b/ipv6rs.c
index 2bdb618..8ebdbd8 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -478,8 +478,6 @@ ipv6rs_handledata(_unused void *arg)
 							l + strlen(cbp) + 2);
 						opt[l] = ' ';
 						strcpy(opt + l + 1, cbp);
-						opt[l + strlen(cbp) + l + 1] =
-						    '\0';
 					} else
 						opt = xstrdup(cbp);
 					if (lifetime > 0)
-- 
1.7.9.4

Follow-Ups:
Re: [PATCH] Remove buffer overrun that leads to a segfault on ipv6 network.Roy Marples
Archive administrator: postmaster@marples.name