[or-cvs] r9328: Fix crash with "tor --list-fingerprint" (reported by seeess) (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Wed Jan 10 23:48:28 UTC 2007


Author: arma
Date: 2007-01-10 18:48:24 -0500 (Wed, 10 Jan 2007)
New Revision: 9328

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuitlist.c
   tor/trunk/src/or/config.c
Log:
Fix crash with "tor --list-fingerprint" (reported by seeess).


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-01-10 22:16:12 UTC (rev 9327)
+++ tor/trunk/ChangeLog	2007-01-10 23:48:24 UTC (rev 9328)
@@ -8,6 +8,7 @@
     - Previously, we would cache up to 16 old networkstatus documents
       indefinitely, if they came from nontrusted authorities.  Now we
       discard them if they are more than 10 days old.
+    - Fix crash with "tor --list-fingerprint" (reported by seeess).
 
 
 Changes in version 0.1.2.6-alpha - 2007-01-09

Modified: tor/trunk/src/or/circuitlist.c
===================================================================
--- tor/trunk/src/or/circuitlist.c	2007-01-10 22:16:12 UTC (rev 9327)
+++ tor/trunk/src/or/circuitlist.c	2007-01-10 23:48:24 UTC (rev 9328)
@@ -585,7 +585,7 @@
   return circ;
 }
 
-/** For each circuits that have <b>conn</b> as n_conn or p_conn, unlink the
+/** For each circuit that has <b>conn</b> as n_conn or p_conn, unlink the
  * circuit from the orconn,circid map, and mark it for close if it hasn't
  * been marked already.
  */

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-01-10 22:16:12 UTC (rev 9327)
+++ tor/trunk/src/or/config.c	2007-01-10 23:48:24 UTC (rev 9328)
@@ -904,16 +904,16 @@
     tor_free(fn);
   }
 
+  /* Load state */
+  if (! global_state)
+    if (or_state_load())
+      return -1;
+
   /* Bail out at this point if we're not going to be a client or server:
    * we want to not fork, and to log stuff to stderr. */
   if (options->command != CMD_RUN_TOR)
     return 0;
 
-  /* Load state */
-  if (! global_state)
-    if (or_state_load())
-      return -1;
-
   {
     smartlist_t *sl = smartlist_create();
     char *errmsg = NULL;
@@ -3881,6 +3881,7 @@
 or_state_t *
 get_or_state(void)
 {
+  tor_assert(global_state);
   return global_state;
 }
 



More information about the tor-commits mailing list