summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--discover/network.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/discover/network.c b/discover/network.c
index 9aa9752..edb7358 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -480,9 +480,10 @@ static void network_init_dns(struct network *network)
}
dns_conf_len = strlen(dns_conf);
- buf = talloc_realloc(network, buf, char, len + dns_conf_len);
+ buf = talloc_realloc(network, buf, char, len + dns_conf_len + 1);
memcpy(buf + len, dns_conf, dns_conf_len);
len += dns_conf_len;
+ buf[len - 1] = '\0';
modified = true;
talloc_free(dns_conf);
OpenPOWER on IntegriCloud