cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2234923 ] Curl_if2ip crashes on NULL ifa_addr

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 07 Nov 2008 18:35:14 +0000

Bugs item #2234923, was opened at 2008-11-07 08:04
Message generated for change (Settings changed) made by dfandrich
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2234923&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: crash
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Adam Sampson (adamsampson)
>Assigned to: Dan Fandrich (dfandrich)
Summary: Curl_if2ip crashes on NULL ifa_addr

Initial Comment:
On my Linux 2.6.26.6 machine, getifaddrs() returns a struct iface with a NULL ifa_addr field for the teql0 interface -- presumably because it doesn't really have an address (it's a virtual interface for load-balancing that you can bind other interfaces to). In gdb, the struct looks like this:

$3 = {ifa_next = 0x9242418, ifa_name = 0x9242404 "teql0", ifa_flags = 128,
      ifa_addr = 0x0, ifa_netmask = 0x0, ifa_ifu = { ifu_broadaddr = 0x0,
      ifu_dstaddr = 0x0}, ifa_data = 0x9242d38}

which corresponds to what "ip link show teql0" displays:

2: teql0: <NOARP> mtu 1500 qdisc noop qlen 100
    link/void

(That "/void" would normally be a hardware address of some kind for a real interface.)

This causes Curl_if2ip to crash, because it enumerates all the interfaces, assuming ifa_addr is a valid pointer for each one. I've attached a patch against curl-7.19.1 to make it check for this.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2234923&group_id=976
Received on 2008-11-07

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET