dnsapi: Use FIELD_OFFSET for the size of a struct with var length array.

This commit is contained in:
Michael Stefaniuc 2012-12-10 10:17:02 +01:00 committed by Alexandre Julliard
parent f52f910f8b
commit c0092bcd76

View File

@ -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;