Commit 0bbce793 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

iphlpapi: Don't crash when enumerating PtP interfaces.

parent 914472ab
...@@ -807,7 +807,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs ...@@ -807,7 +807,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs
getInterfaceNameByIndex(index, name); getInterfaceNameByIndex(index, name);
for (p = ifa, n = 0; p; p = p->ifa_next) for (p = ifa, n = 0; p; p = p->ifa_next)
if (p->ifa_addr->sa_family == AF_INET6 && !strcmp(name, p->ifa_name)) if (p->ifa_addr && p->ifa_addr->sa_family == AF_INET6 &&
!strcmp(name, p->ifa_name))
n++; n++;
if (n) if (n)
{ {
...@@ -820,7 +821,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs ...@@ -820,7 +821,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs
for (p = ifa, n = 0; p; p = p->ifa_next) for (p = ifa, n = 0; p; p = p->ifa_next)
{ {
if (p->ifa_addr->sa_family == AF_INET6 && !strcmp(name, p->ifa_name)) if (p->ifa_addr && p->ifa_addr->sa_family == AF_INET6 &&
!strcmp(name, p->ifa_name))
{ {
struct sockaddr_in6 *addr = (struct sockaddr_in6 *)p->ifa_addr; struct sockaddr_in6 *addr = (struct sockaddr_in6 *)p->ifa_addr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment