Module: wine Branch: master Commit: 9b626f512037a8ca615b0ef4d210096df11d3663 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9b626f512037a8ca615b0ef4d...
Author: Alex Henrie alexhenrie24@gmail.com Date: Thu Jun 28 13:54:45 2018 +0200
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
---
dlls/iphlpapi/ifenum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index eed1be1..c3abdf0 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -1013,13 +1013,13 @@ static DWORD enumIPAddresses(PDWORD pcAddresses, struct ifconf *ifc)
if (ioctlRet == 0) { 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;
if (ifr->ifr_addr.sa_family == AF_INET) numAddresses++;
- ifPtr += ifreq_len((struct ifreq *)ifPtr); + ifPtr = (char *)ifPtr + ifreq_len((struct ifreq *)ifPtr); } } else @@ -1074,10 +1074,10 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags) ret = NO_ERROR; (*ppIpAddrTable)->dwNumEntries = numAddresses; 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;
- ifPtr += ifreq_len(ifr); + ifPtr = (char *)ifPtr + ifreq_len(ifr);
if (ifr->ifr_addr.sa_family != AF_INET) continue;