[PATCH] iphlpapi: Cast caddr_t to char* before doing pointer arithmetic
Alex Henrie
alexhenrie24 at gmail.com
Thu Jun 28 06:54:45 CDT 2018
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
Fixes https://bugs.winehq.org/show_bug.cgi?id=18164
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 eed1be15d1..c3abdf0e53 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;
--
2.18.0
More information about the wine-devel
mailing list