summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/dns/dns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/dns/dns.c b/src/vnet/dns/dns.c
index eac95450485..304aa1868fe 100644
--- a/src/vnet/dns/dns.c
+++ b/src/vnet/dns/dns.c
@@ -821,6 +821,10 @@ vnet_dns_resolve_name (dns_main_t * dm, u8 * name, dns_pending_request_t * t,
/* In case we can't actually answer the question right now... */
*retp = 0;
+ /* binary API caller might forget to set the name. Guess how we know. */
+ if (name[0] == 0)
+ return VNET_API_ERROR_INVALID_VALUE;
+
dns_cache_lock (dm);
search_again:
p = hash_get_mem (dm->cache_entry_by_name, name);