From dfe48bab07aee196284b2c02641d353eb390f08d Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 22 Jan 2018 10:19:05 +0100 Subject: [PATCH] dnsapi: Use default server list if passed in array is empty. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/dnsapi/query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index a66db37e9e5..74b70967ae0 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -547,6 +547,7 @@ static DNS_STATUS dns_set_serverlist( const IP4_ARRAY *addrs ) { int i; + if (!addrs || !addrs->AddrCount) return ERROR_SUCCESS; if (addrs->AddrCount > MAXNS) { WARN( "too many servers: %d only using the first: %d\n", @@ -716,8 +717,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser initialise_resolver(); _res.options |= dns_map_options( options ); - if (servers && (ret = dns_set_serverlist( servers ))) - return ret; + if ((ret = dns_set_serverlist( servers ))) return ret; ret = dns_do_query( name, type, options, result );