Clear the address when we can't choose a reachable address

When the fascist_firewall_choose_address_ functions don't find a
reachable address, set the returned address to the null address and port.

This is a precautionary measure, because some callers do not check the
return value.

Fixes bug 24736; bugfix on 0.2.8.2-alpha.
This commit is contained in:
teor 2017-12-25 01:53:14 +11:00
parent 7d845976e3
commit 09b9a35c07
No known key found for this signature in database
GPG Key ID: 740D9E39025272A2
2 changed files with 8 additions and 0 deletions

6
changes/bug24736 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes (address selection):
- When the fascist_firewall_choose_address_ functions don't find a
reachable address, set the returned address to the null address and port.
This is a precautionary measure, because some callers do not check the
return value.
Fixes bug 24736; bugfix on 0.2.8.2-alpha.

View File

@ -860,6 +860,8 @@ fascist_firewall_choose_address_base(const tor_addr_t *ipv4_addr,
ap->port = result->port;
return 1;
} else {
tor_addr_make_null(&ap->addr, AF_UNSPEC);
ap->port = 0;
return 0;
}
}