aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-04 12:01:49 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-04 12:01:49 -0400
commit09dbcf3b82c6db76024a5345b98f34028b40c30c (patch)
tree058d079c81df843be21d625a166b5dfc1e38fc24 /src/or/circuitlist.c
parent8b9a2cb68b290e550695124d7ef0511225b451d5 (diff)
downloadtor-09dbcf3b82c6db76024a5345b98f34028b40c30c.tar
tor-09dbcf3b82c6db76024a5345b98f34028b40c30c.tar.gz
Fix to 9841 fix: setting a token to NULL should clear it
Found by testing with chutney. The old behavior was "fail an assertion", which obviously isn't optimal. Bugfix on 8b9a2cb68b290e550695124d7ef0511225b451d5; bug not in any released version.
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 8ab673c96..be71fdd08 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1233,6 +1233,11 @@ circuit_set_rend_token(or_circuit_t *circ, int is_rend_circ,
if (circ->rendinfo)
circuit_clear_rend_token(circ);
+ if (token == NULL) {
+ /* We were only trying to remove this token, not set a new one. */
+ return;
+ }
+
found_circ = digestmap_get(map, (const char *)token);
if (found_circ) {
tor_assert(found_circ != circ);