Module: wine Branch: master Commit: 6b033cc1e61a1ac50753b52c1b267f34a3a7ee54 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b033cc1e61a1ac50753b52c1b...
Author: Ken Thomases ken@codeweavers.com Date: Thu Dec 21 14:47:20 2006 +0100
iphlpapi: Fixed a problem with enumerating network interfaces.
Keep increasing the buffer until the returned length is more than two records smaller than the buffer we provided.
---
dlls/iphlpapi/ifenum.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index 52e8413..fb3348f 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -690,7 +690,7 @@ static DWORD enumIPAddresses(PDWORD pcAd ifc->ifc_buf = HeapAlloc(GetProcessHeap(), 0, ifc->ifc_len); ioctlRet = ioctl(fd, SIOCGIFCONF, ifc); } while (ioctlRet == 0 && - ifc->ifc_len == (sizeof(struct ifreq) * guessedNumAddresses)); + ifc->ifc_len > (sizeof(struct ifreq) * (guessedNumAddresses - 2)));
if (ioctlRet == 0) { ifPtr = ifc->ifc_buf;