make sure p->ifa_addr is not NULL before using it#3322
make sure p->ifa_addr is not NULL before using it#3322jscipione wants to merge 1 commit intofish-shell:masterfrom
Conversation
|
This is needed for Haiku which you guys probably don't care much about, but, is a potential problem on all platforms and doesn't cost much. |
|
I'll merge this since it is obviously correct. However, I'm wondering what |
|
There are 2 cases where ifa_addr can be NULL on Haiku, one is if an interface's address.sa_family == AF_UNSPEC and the other is if there was an error copying the interface's address (i.e. new throws an exception). The latter is probably not happening so I'm guessing the case we're running into is the former, one or more of the interfaces has an unspecified address family. I'm not sure whether or not there is a bug on our side here, but it is possible. |
|
Merged as a872d9c. |
Description
p->ifa_addr might be a NULL pointer and thus crash the program
From
http://man7.org/linux/man-pages/man3/getifaddrs.3.html
The ifa_addr field points to a structure containing the interface
address. (The sa_family subfield should be consulted to determine
the format of the address structure.) _This field may contain a null
pointer._