]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Allow NULL circ->p_chan in circuit_is_suitable_for_introduce1()
authorNick Mathewson <nickm@torproject.org>
Tue, 23 Jul 2019 16:36:40 +0000 (12:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 23 Jul 2019 16:36:40 +0000 (12:36 -0400)
This shouldn't be possible while Tor is running, but the tests can
hit this code.  Rather than force the tests to add a dummy channel
object, let's just tolerate their incompletely built circuits.

src/feature/hs/hs_intropoint.c

index 447f73b602ec8bb4b19ae7de22766cb245422676..6383d3ed22030b7e923eac35d59337b395e91443 100644 (file)
@@ -548,7 +548,7 @@ circuit_is_suitable_for_introduce1(const or_circuit_t *circ)
   }
 
   /* Disallow single hop client circuit. */
-  if (channel_is_client(circ->p_chan)) {
+  if (circ->p_chan && channel_is_client(circ->p_chan)) {
     log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
            "Single hop client was rejected while trying to introduce. "
            "Closing circuit.");