]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove buffer overrun that leads to a segfault on ipv6 network.
authorRoy Marples <roy@marples.name>
Fri, 23 Mar 2012 07:38:39 +0000 (07:38 +0000)
committerRoy Marples <roy@marples.name>
Fri, 23 Mar 2012 07:38:39 +0000 (07:38 +0000)
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@gmail.com>
ipv6rs.c

index 2bdb618bd9010db06d52ccf333e3a994d8156859..8ebdbd89f257dee1f3a84583df898bfd88ca2e01 100644 (file)
--- 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)