iphlpapi: Cast caddr_t to char* before doing pointer arithmetic.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2018-06-28 13:54:45 +02:00 committed by Alexandre Julliard
parent 8b864ae9aa
commit 9b626f5120
1 changed files with 4 additions and 4 deletions

View File

@ -1013,13 +1013,13 @@ static DWORD enumIPAddresses(PDWORD pcAddresses, struct ifconf *ifc)
if (ioctlRet == 0) { if (ioctlRet == 0) {
ifPtr = ifc->ifc_buf; ifPtr = ifc->ifc_buf;
while (ifPtr && ifPtr < ifc->ifc_buf + ifc->ifc_len) { while (ifPtr && (char *)ifPtr < ifc->ifc_buf + ifc->ifc_len) {
struct ifreq *ifr = (struct ifreq *)ifPtr; struct ifreq *ifr = (struct ifreq *)ifPtr;
if (ifr->ifr_addr.sa_family == AF_INET) if (ifr->ifr_addr.sa_family == AF_INET)
numAddresses++; numAddresses++;
ifPtr += ifreq_len((struct ifreq *)ifPtr); ifPtr = (char *)ifPtr + ifreq_len((struct ifreq *)ifPtr);
} }
} }
else else
@ -1074,10 +1074,10 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
ret = NO_ERROR; ret = NO_ERROR;
(*ppIpAddrTable)->dwNumEntries = numAddresses; (*ppIpAddrTable)->dwNumEntries = numAddresses;
ifPtr = ifc.ifc_buf; ifPtr = ifc.ifc_buf;
while (!ret && ifPtr && ifPtr < ifc.ifc_buf + ifc.ifc_len) { while (!ret && ifPtr && (char *)ifPtr < ifc.ifc_buf + ifc.ifc_len) {
struct ifreq *ifr = (struct ifreq *)ifPtr; struct ifreq *ifr = (struct ifreq *)ifPtr;
ifPtr += ifreq_len(ifr); ifPtr = (char *)ifPtr + ifreq_len(ifr);
if (ifr->ifr_addr.sa_family != AF_INET) if (ifr->ifr_addr.sa_family != AF_INET)
continue; continue;