Asking for a conditional consensus at .../consensus/<fingerprints> would crash

a dirserver if it did not already have a consensus.


svn:r15227
This commit is contained in:
Peter Palfrader 2008-06-13 18:58:58 +00:00
parent f9fd049f69
commit 1f3dc9b22b
2 changed files with 6 additions and 1 deletions

View File

@ -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:

View File

@ -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: */