]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Refer to the correct variable in a loop when parsing entry guard state
authorNick Mathewson <nickm@torproject.org>
Mon, 16 Jul 2012 15:49:45 +0000 (11:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 16 Jul 2012 15:49:45 +0000 (11:49 -0400)
Fixes bug 6397 and coverity issue 709599. Bugfix on 0.2.3.17-beta.

changes/bug6397 [new file with mode: 0644]
src/or/circuitbuild.c

diff --git a/changes/bug6397 b/changes/bug6397
new file mode 100644 (file)
index 0000000..23d8359
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes:
+    - When disabling guards for having too high a proportion of failed
+      circuits, make sure to look at each guard. Fix for bug 6397; bugfix
+      on 0.2.3.17-beta.
index 6d1e4e76437b3b66516720f0d44a9cfd785d8169..714bbca34e45b5b8cb51aa4f6ded03d716a2b78b 100644 (file)
@@ -4728,8 +4728,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
     }
   }
 
-  SMARTLIST_FOREACH(new_entry_guards, entry_guard_t *, e,
-   {
+  SMARTLIST_FOREACH_BEGIN(new_entry_guards, entry_guard_t *, e) {
      char *sp;
      char *val = digestmap_get(added_by, e->identity);
      if (val && (sp = strchr(val, ' '))) {
@@ -4747,9 +4746,10 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
          e->chosen_on_date = time(NULL) - crypto_rand_int(3600*24*30);
        }
      }
-     if (node->path_bias_disabled && !node->bad_since)
-       node->bad_since = time(NULL);
-   });
+     if (e->path_bias_disabled && !e->bad_since)
+       e->bad_since = time(NULL);
+    }
+  SMARTLIST_FOREACH_END(e);
 
   if (*msg || !set) {
     SMARTLIST_FOREACH(new_entry_guards, entry_guard_t *, e,