diff options
-rw-r--r-- | src/plugins/dns/dns.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/dns/dns.c b/src/plugins/dns/dns.c index 5c51a446d98..870cfae5074 100644 --- a/src/plugins/dns/dns.c +++ b/src/plugins/dns/dns.c @@ -816,6 +816,8 @@ dns_add_static_entry (dns_main_t * dm, u8 * name, u8 * dns_reply_data) /* Note: consumes the name vector */ ep->name = name; + /* make sure it NULL-terminated as hash_set_mem will use strlen() */ + vec_terminate_c_string (ep->name); hash_set_mem (dm->cache_entry_by_name, ep->name, ep - dm->entries); ep->flags = DNS_CACHE_ENTRY_FLAG_VALID | DNS_CACHE_ENTRY_FLAG_STATIC; ep->dns_response = dns_reply_data; |