Commit cd2425ff authored by Nick Mathewson's avatar Nick Mathewson 🌉
Browse files

r8968@Kushana: nickm | 2006-09-26 17:53:27 -0400

 Fix for reverse dns: only assume we will get an answer when the result was success.


svn:r8507
parent 3994b02c
......@@ -861,8 +861,13 @@ add_answer_to_cache(const char *address, int is_reverse, uint32_t addr,
strlcpy(resolve->address, address, sizeof(resolve->address));
resolve->is_reverse = is_reverse;
if (is_reverse) {
tor_assert(hostname);
resolve->result.hostname = tor_strdup(hostname);
if (outcome == DNS_RESOLVE_SUCCEEDED) {
tor_assert(hostname);
resolve->result.hostname = tor_strdup(hostname);
} else {
tor_assert(! hostname);
resolve->result.hostname = NULL;
}
} else {
tor_assert(!hostname);
resolve->result.addr = addr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment