Fix Segmentation fault when ifa_addr is NULL
FossilOrigin-Name: a8a048f9712810e9d9f3cacfe41b27a786b86e14db65998ccbc2416efbf9bcec
This commit is contained in:
parent
77bbcd8fa4
commit
155e4e77ae
@ -37,6 +37,9 @@ char * sock_get_primary_if(int family)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ifa->ifa_addr == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ifa->ifa_addr->sa_family != family)
|
if (ifa->ifa_addr->sa_family != family)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ int sock_getifaddr(const char * ifname,int family, int type,struct sockaddr * sa
|
|||||||
if (strcmp(ifname,ifa->ifa_name))
|
if (strcmp(ifname,ifa->ifa_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (ifa->ifa_addr == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ifa->ifa_addr->sa_family != family)
|
if (ifa->ifa_addr->sa_family != family)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user