]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clear the address when we can't choose a reachable address
authorteor <teor2345@gmail.com>
Sun, 24 Dec 2017 14:53:14 +0000 (01:53 +1100)
committerteor <teor2345@gmail.com>
Sun, 24 Dec 2017 14:55:28 +0000 (01:55 +1100)
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.

changes/bug24736 [new file with mode: 0644]
src/or/policies.c

diff --git a/changes/bug24736 b/changes/bug24736
new file mode 100644 (file)
index 0000000..6325609
--- /dev/null
@@ -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.
index 50fec3a773ba63d8bd13ec237b15868d2732289d..f09a708993fc333ce29eb4aeeab561423a4eb742 100644 (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;
   }
 }