Permalink
Browse files

Fix segmentation fault in get_if_addrs()

  • Loading branch information...
1 parent d2c590d commit 69978c88ed23e20506c9114ea13c07ab94d35469 @fgont fgont committed Aug 10, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 tools/flow6.c
View
@@ -1990,6 +1990,9 @@ int get_if_addrs(struct iface_data *idata){
}
for(ptr=ifptr; ptr != NULL; ptr= ptr->ifa_next){
+ if(ptr->ifa_addr == NULL)
+ continue;
+
#ifdef __linux__
if( !(idata->ether_flag) && ((ptr->ifa_addr)->sa_family == AF_PACKET) && (ptr->ifa_data != NULL)){
if(strncmp(idata->iface, ptr->ifa_name, IFACE_LENGTH-1) == 0){

0 comments on commit 69978c8

Please sign in to comment.