Fix segfault when no broadcast device is found

This commit is contained in:
Nick ODell 2013-08-06 17:07:45 -06:00
parent 7ddeb2bf6d
commit eb546db56b

View File

@ -70,6 +70,10 @@ static uint32_t get_broadcast(void)
} }
} }
close(sock); close(sock);
if(sock_holder == NULL) {
perror("[!] no broadcast device found");
return 0;
}
return sock_holder->sin_addr.s_addr; return sock_holder->sin_addr.s_addr;
} }