diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index 72490c57054..2116b113da4 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -563,7 +563,7 @@ static DNS_STATUS dns_get_serverlist( PIP4_ARRAY addrs, PDWORD len ) unsigned int size; int i; - size = sizeof(IP4_ARRAY) + sizeof(IP4_ADDRESS) * (_res.nscount - 1); + size = FIELD_OFFSET(IP4_ARRAY, AddrArray[_res.nscount]); if (!addrs || *len < size) { *len = size;