diff options
author | Andrea Shepard <andrea@torproject.org> | 2012-10-01 14:55:33 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2012-10-10 00:44:46 -0700 |
commit | 903cc8acd12ae2484ba2ad2a7ac1cb1b9bb88638 (patch) | |
tree | d4985281b0c196117e5ce9d3c99c21872506b130 /src | |
parent | a0200c1f6e5b85a70a3f2bdc16bd7dd8b50eeb30 (diff) | |
download | tor-903cc8acd12ae2484ba2ad2a7ac1cb1b9bb88638.tar tor-903cc8acd12ae2484ba2ad2a7ac1cb1b9bb88638.tar.gz |
Allow n_chan to be NULL in circuitmux_find_map_entry(); it can be but with non-NULL p_chan when extending a circuit
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitmux.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c index e27a7900e..b782fdbe8 100644 --- a/src/or/circuitmux.c +++ b/src/or/circuitmux.c @@ -655,15 +655,17 @@ circuitmux_find_map_entry(circuitmux_t *cmux, circuit_t *circ) tor_assert(cmux); tor_assert(cmux->chanid_circid_map); tor_assert(circ); - tor_assert(circ->n_chan); - /* Okay, let's see if it's attached for n_chan/n_circ_id */ - search.chan_id = circ->n_chan->global_identifier; - search.circ_id = circ->n_circ_id; + /* Check if we have n_chan */ + if (circ->n_chan) { + /* Okay, let's see if it's attached for n_chan/n_circ_id */ + search.chan_id = circ->n_chan->global_identifier; + search.circ_id = circ->n_circ_id; - /* Query */ - hashent = HT_FIND(chanid_circid_muxinfo_map, cmux->chanid_circid_map, - &search); + /* Query */ + hashent = HT_FIND(chanid_circid_muxinfo_map, cmux->chanid_circid_map, + &search); + } /* Found something? */ if (hashent) { |