瀏覽代碼

Fix crash with "tor --list-fingerprint" (reported by seeess).

svn:r9328
Roger Dingledine 19 年之前
父節點
當前提交
35bd6caa1a
共有 3 個文件被更改,包括 8 次插入6 次删除
  1. 1 0
      ChangeLog
  2. 1 1
      src/or/circuitlist.c
  3. 6 5
      src/or/config.c

+ 1 - 0
ChangeLog

@@ -8,6 +8,7 @@ Changes in version 0.1.2.7-alpha - 2007-??-??
     - Previously, we would cache up to 16 old networkstatus documents
     - Previously, we would cache up to 16 old networkstatus documents
       indefinitely, if they came from nontrusted authorities.  Now we
       indefinitely, if they came from nontrusted authorities.  Now we
       discard them if they are more than 10 days old.
       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
 Changes in version 0.1.2.6-alpha - 2007-01-09

+ 1 - 1
src/or/circuitlist.c

@@ -585,7 +585,7 @@ circuit_get_by_edge_conn(edge_connection_t *conn)
   return circ;
   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
  * circuit from the orconn,circid map, and mark it for close if it hasn't
  * been marked already.
  * been marked already.
  */
  */

+ 6 - 5
src/or/config.c

@@ -904,16 +904,16 @@ options_act(or_options_t *old_options)
     tor_free(fn);
     tor_free(fn);
   }
   }
 
 
-  /* 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 */
   /* Load state */
   if (! global_state)
   if (! global_state)
     if (or_state_load())
     if (or_state_load())
       return -1;
       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;
+
   {
   {
     smartlist_t *sl = smartlist_create();
     smartlist_t *sl = smartlist_create();
     char *errmsg = NULL;
     char *errmsg = NULL;
@@ -3881,6 +3881,7 @@ decode_libevent_version(void)
 or_state_t *
 or_state_t *
 get_or_state(void)
 get_or_state(void)
 {
 {
+  tor_assert(global_state);
   return global_state;
   return global_state;
 }
 }