]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix to 9841 fix: setting a token to NULL should clear it
authorNick Mathewson <nickm@torproject.org>
Fri, 4 Apr 2014 16:01:49 +0000 (12:01 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 4 Apr 2014 16:01:49 +0000 (12:01 -0400)
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.

src/or/circuitlist.c

index 8ab673c965bc01e20f3950456e0d1971a3c36077..be71fdd08c710b9a7418498d7b7cdc6f5ca23ebb 100644 (file)
@@ -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);