]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
get_interface_address6_list(): Bring back a return code check
authorFabian Keil <fk@fabiankeil.de>
Mon, 28 Sep 2015 14:57:07 +0000 (16:57 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 29 Sep 2015 08:17:00 +0000 (10:17 +0200)
... that was removed by 31eb486c46 which first appeared in
0.2.7.3-rc.

If tor is running in a ElectroBSD (or FreeBSD) jail it can't
get any IP addresses that aren't assigned to the jail by
looking at the interfaces and (by design) the
get_interface_address6_via_udp_socket_hack() fallback doesn't
work either.

The missing return code check resulted in tor_addr_is_internal()
complaining about a "non-IP address of type 49", due to reading
uninitialised memory.

Fixes #17173.

src/common/address.c

index 163db59ac4d8661f73110c39d7daada27d210440..fc85f8eba2c40d2b9b152bb729d79d291790bb4a 100644 (file)
@@ -1711,7 +1711,8 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
   }
 
   /* Okay, the smart way is out. */
-  get_interface_address6_via_udp_socket_hack(severity,family,&addr);
+  if (get_interface_address6_via_udp_socket_hack(severity,family,&addr))
+     return smartlist_new();
   if (!include_internal && tor_addr_is_internal(&addr, 0)) {
     return smartlist_new();
   } else {