Changeset 3030


Ignore:
Timestamp:
Dec 10, 2009 4:56:26 AM (10 years ago)
Author:
bennylp
Message:

More ticket #1000 (IPv6 interface enumeration fails due to typo error in Windows targets):

  • fixed crash if GetAdaptersAddresses?() returns adapter with NULL "firstUnicastAddress". This happens when the interface is disabled.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ip_helper_win32.c

    r3029 r3030  
    238238 
    239239    for (i=0; i<*p_cnt && adapter; ++i, adapter = adapter->Next) { 
    240         SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; 
    241         ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; 
    242         pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); 
     240        if (adapter->FirstUnicastAddress) { 
     241            SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; 
     242            ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; 
     243            pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); 
     244        } 
    243245    } 
    244246 
Note: See TracChangeset for help on using the changeset viewer.