Pārlūkot izejas kodu

Merge remote-tracking branch 'public/bug21128'

Nick Mathewson 7 gadi atpakaļ
vecāks
revīzija
f8885b76ef
2 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 5 0
      changes/bug21128
  2. 5 1
      src/or/entrynodes.c

+ 5 - 0
changes/bug21128

@@ -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.
+

+ 5 - 1
src/or/entrynodes.c

@@ -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);
 }