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));
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;