tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 98a1b8770cc6a52cd958d49882dbbadd6ae212f0
parent 7232f04939f44146254c21086178c62cce1d3392
Author: Nick Mathewson <nickm@torproject.org>
Date:   Thu,  3 Jan 2019 21:34:43 -0500

Merge branch 'maint-0.3.5'

Diffstat:
Achanges/ticket28879 | 5+++++
Msrc/feature/relay/dns.c | 5++++-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/changes/ticket28879 b/changes/ticket28879 @@ -0,0 +1,5 @@ + o Minor bugfixes (correctness): + - Fix an unreached code-path where we checked the value of "hostname" + inside send_resolved_hostnam_cell(). Previously, we used it before + checking it; now we check it first. Fixes bug 28879; bugfix on + 0.1.2.7-alpha. diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c @@ -586,8 +586,11 @@ send_resolved_hostname_cell,(edge_connection_t *conn, char buf[RELAY_PAYLOAD_SIZE]; size_t buflen; uint32_t ttl; + + if (BUG(!hostname)) + return; + size_t namelen = strlen(hostname); - tor_assert(hostname); tor_assert(namelen < 256); ttl = dns_clip_ttl(conn->address_ttl);