mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:53:32 +03:00
The getifaddrs() version of Curl_if2ip() crashed when used on a Linux
system with a TEQL load-balancing device configured, which doesn't have an address. Thanks to Adam Sampson for spotting this (bug #2234923).
This commit is contained in:
parent
95a849efc2
commit
6354cbf9d6
3 changed files with 9 additions and 2 deletions
|
|
@ -78,7 +78,8 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
|
|||
|
||||
if (getifaddrs(&head) >= 0) {
|
||||
for (iface=head; iface != NULL; iface=iface->ifa_next) {
|
||||
if ((iface->ifa_addr->sa_family == af) &&
|
||||
if ((iface->ifa_addr != NULL) &&
|
||||
(iface->ifa_addr->sa_family == af) &&
|
||||
curl_strequal(iface->ifa_name, interface)) {
|
||||
void *addr;
|
||||
char scope[12]="";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue