[patch] fix wget crash when given a numeric url
Peter Korsgaard
jacmet at sunsite.dk
Wed Mar 23 15:50:18 UTC 2011
>>>>> "Denys" == Denys Vlasenko <vda.linux at googlemail.com> writes:
Hi,
>> Hi, folks. I'm having a problem with busybox on FreeBSD: it segfaults
>> when I run something like this:
>>
>> $ busybox wget http://1.2.3.4
>>
>> The reason for this is line 288 of ibbb/xconnect.c: result is freed
>> there, but if the address is numeric, it will contain NULL, hence
>> the segfault.
>>
>> In short, the trivial fix is attached (if the attachment doesn't
>> get through, it simply prefixes the freeaddinfo call with a
>> conditional on result).
Denys> Applied, thanks!
Please put it on http://busybox.net/downloads/fixes-1.18.4/ as well.
On both glibc and uclibc, freeaddrinfo(NULL) is safe, but I don't see
any explicit requirements for it in the spec:
http://pubs.opengroup.org/onlinepubs/009695399/functions/getaddrinfo.html
--
Bye, Peter Korsgaard
More information about the busybox
mailing list