]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
When marking guard state instances on a channel, don't mark NULL
authorNick Mathewson <nickm@torproject.org>
Tue, 31 Jan 2017 19:44:14 +0000 (14:44 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 31 Jan 2017 19:44:14 +0000 (14:44 -0500)
It's okay for guard_state to be null: we might have a fallback
circuit, or we might not be using guards.

Fixes bug 211228; bugfix on 0.3.0.1-alpha

changes/bug21128 [new file with mode: 0644]
src/or/entrynodes.c

diff --git a/changes/bug21128 b/changes/bug21128
new file mode 100644 (file)
index 0000000..972d2a2
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (client, entry guards):
+    - Fix a bug warning (with backtrace) when we fail a channel
+      that circuits to fallback directories on it. Fixes bug 21128;
+      bugfix on 0.3.0.1-alpha.
+
index c5fb92e35a434a489814e4b6556e842510ed877d..f9b3b60a6f364c89f38dcb2115b6a1103711e094 100644 (file)
@@ -2172,7 +2172,11 @@ entry_guard_chan_failed(channel_t *chan)
       continue;
 
     origin_circuit_t *origin_circ = TO_ORIGIN_CIRCUIT(circ);
-    entry_guard_failed(&origin_circ->guard_state);
+    if (origin_circ->guard_state) {
+      /* We might have no guard state if we didn't use a guard on this
+       * circuit (eg it's for a fallback directory). */
+      entry_guard_failed(&origin_circ->guard_state);
+    }
   } SMARTLIST_FOREACH_END(circ);
   smartlist_free(pending);
 }