Kaynağa Gözat

Asking for a conditional consensus at .../consensus/<fingerprints> would crash
a dirserver if it did not already have a consensus.


svn:r15227

Peter Palfrader 17 yıl önce
ebeveyn
işleme
1f3dc9b22b
2 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 3 0
      ChangeLog
  2. 3 1
      src/or/directory.c

+ 3 - 0
ChangeLog

@@ -1,6 +1,9 @@
 Changes in version 0.2.1.2-alpha - 2008-??-??
   o Minor features:
     - Allow OpenSSL to use dynamic locks if it wants.
+  o Bugfixes:
+    - Asking for a conditional consensus at .../consensus/<fingerprints>
+      would crash a dirserver if it did not already have a consensus.
 
 Changes in version 0.2.1.1-alpha - 2008-06-13
   o Major features:

+ 3 - 1
src/or/directory.c

@@ -2493,7 +2493,8 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
       networkstatus_t *v = networkstatus_get_latest_consensus();
       time_t now = time(NULL);
       #define CONSENSUS_URL_PREFIX "/tor/status-vote/current/consensus/"
-      if (!strcmpstart(url, CONSENSUS_URL_PREFIX) &&
+      if (v &&
+          !strcmpstart(url, CONSENSUS_URL_PREFIX) &&
           !client_likes_consensus(v, url + strlen(CONSENSUS_URL_PREFIX))) {
         write_http_status_line(conn, 404, "Consensus not signed by sufficient "
                                           "number of requested authorities");
@@ -3430,3 +3431,4 @@ dir_split_resource_into_fingerprints(const char *resource,
   return 0;
 }
 
+/* vim:set et ts=2: */