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).
--- libbb/xconnect.c.orig	2011-03-22 19:06:24.000000000 +0200
+++ libbb/xconnect.c	2011-03-22 19:07:29.000000000 +0200
@@ -285,7 +285,8 @@
  set_port:
 	set_nport(r, htons(port));
  ret:
-	freeaddrinfo(result);
+	if (result)
+		freeaddrinfo(result);
 	return r;
 }
 #if !ENABLE_FEATURE_IPV6
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to