dnsapi: Use FIELD_OFFSET for the size of a struct with var length array.
This commit is contained in:
parent
f52f910f8b
commit
c0092bcd76
|
@ -563,7 +563,7 @@ static DNS_STATUS dns_get_serverlist( PIP4_ARRAY addrs, PDWORD len )
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
size = sizeof(IP4_ARRAY) + sizeof(IP4_ADDRESS) * (_res.nscount - 1);
|
size = FIELD_OFFSET(IP4_ARRAY, AddrArray[_res.nscount]);
|
||||||
if (!addrs || *len < size)
|
if (!addrs || *len < size)
|
||||||
{
|
{
|
||||||
*len = size;
|
*len = size;
|
||||||
|
|
Loading…
Reference in New Issue