From 1f3dc9b22b39257e433282039ffd20adf161af6d Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 13 Jun 2008 18:58:58 +0000 Subject: [PATCH] Asking for a conditional consensus at .../consensus/ would crash a dirserver if it did not already have a consensus. svn:r15227 --- ChangeLog | 3 +++ src/or/directory.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 73b496c16c..a446172dea 100644 --- a/ChangeLog +++ b/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/ + 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: diff --git a/src/or/directory.c b/src/or/directory.c index 1cf6f2b38d..419891fd7f 100644 --- a/src/or/directory.c +++ b/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: */