diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
commit | d3c05a79f0b3e688e43edfffe9886664777517f7 (patch) | |
tree | caf18aa657f83c5bf224bd2750dc5e81d2000e3d /src/or/circuitlist.c | |
parent | 12b1d64b0378450fb8c69dfe81fde2d1cd1b36b1 (diff) | |
parent | 5470795b834a788ec482f22091d58b27a1999a2d (diff) | |
download | tor-d3c05a79f0b3e688e43edfffe9886664777517f7.tar.gz tor-d3c05a79f0b3e688e43edfffe9886664777517f7.zip |
Merge branch 'scanbuild_fixes'
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 8a8fc8b4ed..c54a95419a 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1269,8 +1269,16 @@ circuit_get_by_rend_token_and_purpose(uint8_t purpose, int is_rend_circ, circ->base_.marked_for_close) return NULL; - if (!circ->rendinfo || - ! bool_eq(circ->rendinfo->is_rend_circ, is_rend_circ) || + if (!circ->rendinfo) { + char *t = tor_strdup(hex_str(token, REND_TOKEN_LEN)); + log_warn(LD_BUG, "Wanted a circuit with %s:%d, but lookup returned a " + "circuit with no rendinfo set.", + safe_str(t), is_rend_circ); + tor_free(t); + return NULL; + } + + if (! bool_eq(circ->rendinfo->is_rend_circ, is_rend_circ) || tor_memneq(circ->rendinfo->rend_token, token, REND_TOKEN_LEN)) { char *t = tor_strdup(hex_str(token, REND_TOKEN_LEN)); log_warn(LD_BUG, "Wanted a circuit with %s:%d, but lookup returned %s:%d", |