summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2023-05-30 18:11:13 +0000
committerFelix Fietkau2023-05-30 18:11:14 +0000
commit51be0ed659d0c8e86ef28b0de3da6b38809fa170 (patch)
tree186d72bae28351ce0d338f01c7d72b2a47e10056
parent0e1c2fad3540fe3a17cbfa9cb3ac9d70670258f4 (diff)
downloadunetd-51be0ed659d0c8e86ef28b0de3da6b38809fa170.tar.gz
host: fix crash parsing gateway when no endpoint is specified
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/host.c b/host.c
index 7522e8b..e4e38d3 100644
--- a/host.c
+++ b/host.c
@@ -179,7 +179,7 @@ network_host_create(struct network *net, struct blob_attr *attr, bool dynamic)
&ipaddr, ipaddr_len,
&subnet, subnet_len,
&endpoint_buf, endpoint ? strlen(endpoint) + 1 : 0,
- &gateway_buf, gateway ? strlen(endpoint) + 1 : 0);
+ &gateway_buf, gateway ? strlen(gateway) + 1 : 0);
host->node.key = strcpy(name_buf, name);
peer = &host->peer;
}