aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns_resolver/dns_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dns_resolver/dns_query.c')
-rw-r--r--net/dns_resolver/dns_query.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c
index c32be29..2022b46 100644
--- a/net/dns_resolver/dns_query.c
+++ b/net/dns_resolver/dns_query.c
@@ -150,7 +150,9 @@ int dns_query(const char *type, const char *name, size_t namelen,
if (!*_result)
goto put;
- memcpy(*_result, upayload->data, len + 1);
+ memcpy(*_result, upayload->data, len);
+ (*_result)[len] = '\0';
+
if (_expiry)
*_expiry = rkey->expiry;