From 0bbce793c315018ff20e10fcfa742d937f0f8e28 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 16 Mar 2010 01:09:40 +0100 Subject: [PATCH] iphlpapi: Don't crash when enumerating PtP interfaces. --- dlls/iphlpapi/ifenum.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index 8653454c1a3..5a3db75c971 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -807,7 +807,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs getInterfaceNameByIndex(index, name); 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++; if (n) { @@ -820,7 +821,8 @@ ULONG v6addressesFromIndex(DWORD index, SOCKET_ADDRESS **addrs, ULONG *num_addrs 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;