starter: Make sure interface name is null-terminated.
authorTobias Brunner <tobias@strongswan.org>
Tue, 19 Apr 2011 11:18:42 +0000 (13:18 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 Apr 2011 11:48:51 +0000 (13:48 +0200)
src/starter/interfaces.c

index ef26cdc..4a2ae0a 100644 (file)
@@ -153,6 +153,7 @@ get_defaultroute(defaultroute_t *defaultroute)
                        }
 
                        strncpy(defaultroute->iface, req.ifr_name, IFNAMSIZ);
+                       defaultroute->iface[IFNAMSIZ-1] = '\0';
                        defaultroute->addr.u.v4 = *((struct sockaddr_in *) &req.ifr_addr);
                        defaultroute->nexthop.u.v4.sin_family = AF_INET;