diff options
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c index 5b0d7c2ca..fb4af9112 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1523,8 +1523,17 @@ getinfo_helper_dir(control_connection_t *control_conn, if (strlen(question) == HEX_DIGEST_LEN) { char d[DIGEST_LEN]; signed_descriptor_t *sd = NULL; - if (base16_decode(d, sizeof(d), question, strlen(question))==0) - sd = extrainfo_get_by_descriptor_digest(d); + if (base16_decode(d, sizeof(d), question, strlen(question))==0) { + /* XXXX this test should move into extrainfo_get_by_descriptor_digest, + * but I don't want to risk affecting other parts of the code, + * especially since the rules for using our own extrainfo (including + * when it might be freed) are different from those for using one + * we have downloaded. */ + if (router_extrainfo_digest_is_me(d)) + sd = &(router_get_my_extrainfo()->cache_info); + else + sd = extrainfo_get_by_descriptor_digest(d); + } if (sd) { const char *body = signed_descriptor_get_body(sd); if (body) |