summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config.y b/src/config.y
index af93864..f2f597f 100644
--- a/src/config.y
+++ b/src/config.y
@@ -491,10 +491,11 @@ peer_remote: maybe_ipv4 TOK_ADDR4 port {
addrlen = strlen(addrbuf);
fastd_remote_t remote = {};
- remote.hostname = fastd_alloc(addrlen + strlen($2.ifname) + 2);
+ size_t ifname_len = strlen($2.ifname);
+ remote.hostname = fastd_alloc(addrlen + ifname_len + 2);
memcpy(remote.hostname, addrbuf, addrlen);
remote.hostname[addrlen] = '%';
- strcpy(remote.hostname+addrlen+1, $2.ifname);
+ memcpy(remote.hostname+addrlen+1, $2.ifname, ifname_len+1);
remote.address.sa.sa_family = AF_INET6;
remote.address.in.sin_port = htons($3);