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
This commit is contained in:
Nick Mathewson 2006-09-26 22:03:23 +00:00
parent 3994b02c0e
commit cd2425ffa0

View File

@ -861,8 +861,13 @@ add_answer_to_cache(const char *address, int is_reverse, uint32_t addr,
strlcpy(resolve->address, address, sizeof(resolve->address)); strlcpy(resolve->address, address, sizeof(resolve->address));
resolve->is_reverse = is_reverse; resolve->is_reverse = is_reverse;
if (is_reverse) { if (is_reverse) {
if (outcome == DNS_RESOLVE_SUCCEEDED) {
tor_assert(hostname); tor_assert(hostname);
resolve->result.hostname = tor_strdup(hostname); resolve->result.hostname = tor_strdup(hostname);
} else {
tor_assert(! hostname);
resolve->result.hostname = NULL;
}
} else { } else {
tor_assert(!hostname); tor_assert(!hostname);
resolve->result.addr = addr; resolve->result.addr = addr;