commit 3ea834ce0a63f275fd806f9ebeec64a2bbcd1b55 Author: Fabian Keil fk@fabiankeil.de Date: Mon Sep 28 16:57:07 2015 +0200
get_interface_address6_list(): Bring back a return code check
... 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/common/address.c b/src/common/address.c index 163db59..fc85f8e 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -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 {