aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-01-06 18:05:48 +0000
committerNick Mathewson <nickm@torproject.org>2006-01-06 18:05:48 +0000
commitf0fb9f6b0cd63f3c84d1a58ad6f6355b3c2e211b (patch)
treefb37a8ab817768cfdb1196532600d37750415ac0 /src/or/directory.c
parent65f76bad4f6bbb00b6ee62fa6ddb5628f8cdf5de (diff)
downloadtor-f0fb9f6b0cd63f3c84d1a58ad6f6355b3c2e211b.tar.gz
tor-f0fb9f6b0cd63f3c84d1a58ad6f6355b3c2e211b.zip
Directory authorities should go to the proper authority when asking for a networkstatus, even when they want a compressed one. (Also, bullet-proof the logic in case we ever accidentally request a networkstatus for a non-authority.)
svn:r5740
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 855c0b5f28..405e477761 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -167,13 +167,14 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource,
if (directconn) {
if (fetch_fresh_first && purpose == DIR_PURPOSE_FETCH_NETWORKSTATUS &&
- !strcmpstart(resource,"fp/") && strlen(resource) == HEX_DIGEST_LEN+3) {
+ !strcmpstart(resource,"fp/") && strlen(resource) >= HEX_DIGEST_LEN+3) {
/* Try to ask the actual dirserver its opinion. */
char digest[DIGEST_LEN];
trusted_dir_server_t *ds;
base16_decode(digest, DIGEST_LEN, resource+3, HEX_DIGEST_LEN);
ds = router_get_trusteddirserver_by_digest(digest);
- rs = &(ds->fake_status);
+ if (ds)
+ rs = &(ds->fake_status);
}
if (!rs && fetch_fresh_first) {
/* only ask authdirservers, and don't ask myself */