Merge pull request #2 from alagoutte/seg_fault
Fix Segmentation fault when ifa_addr is NULL FossilOrigin-Name: 7c65e3ac0d826fbc5c90938fe38ccc59e86e891ec538cdf55636349b76213d4c
This commit is contained in:
commit
9961889d96
@ -37,6 +37,9 @@ char * sock_get_primary_if(int family)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ifa->ifa_addr == NULL)
|
||||
continue;
|
||||
|
||||
if (ifa->ifa_addr->sa_family != family)
|
||||
continue;
|
||||
|
||||
|
@ -37,6 +37,9 @@ int sock_getifaddr(const char * ifname,int family, int type,struct sockaddr * sa
|
||||
if (strcmp(ifname,ifa->ifa_name))
|
||||
continue;
|
||||
|
||||
if (ifa->ifa_addr == NULL)
|
||||
continue;
|
||||
|
||||
if (ifa->ifa_addr->sa_family != family)
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user