summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-21 21:48:11 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-21 21:48:11 +0000
commit083e9c2b59614bd5dae78d5db2473ddbca9cb8c4 (patch)
tree3035761b18c56107cc56995c3fced1ae3c3796c5 /src/or/dns.c
parenta942441615af65a5e80f2d8c1348a4feb7a2ff62 (diff)
downloadtor-083e9c2b59614bd5dae78d5db2473ddbca9cb8c4.tar.gz
tor-083e9c2b59614bd5dae78d5db2473ddbca9cb8c4.zip
r8873@Kushana: nickm | 2006-09-21 14:38:22 -0400
Fix a bug: Remember, each call to escaped() replaces the value returned from the last call to escaped(). svn:r8438
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 03ed0c03f4..f2ebc2e481 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -1464,20 +1464,26 @@ eventdns_callback(int result, char type, int count, int ttl, void *addresses,
if (type == DNS_IPv4_A && count) {
char answer_buf[INET_NTOA_BUF_LEN+1];
struct in_addr in;
+ char *escaped_address;
uint32_t *addrs = addresses;
in.s_addr = addrs[0];
addr = ntohl(addrs[0]);
status = DNS_RESOLVE_SUCCEEDED;
tor_inet_ntoa(&in, answer_buf, sizeof(answer_buf));
+ escaped_address = esc_for_log(string_address);
log_debug(LD_EXIT, "eventdns said that %s resolves to %s",
- escaped_safe_str(string_address),
- escaped_safe_str(answer_buf)); // XXXX not ok.
+ safe_str(escaped_address),
+ escaped_safe_str(answer_buf));
+ tor_free(escaped_address);
} else if (type == DNS_PTR && count) {
+ char *escaped_address;
is_reverse = 1;
hostname = ((char**)addresses)[0];
+ escaped_address = esc_for_log(string_address);
log_debug(LD_EXIT, "eventdns said that %s resolves to %s",
- escaped_safe_str(string_address),
- escaped_safe_str(hostname)); // XXXX not ok.
+ safe_str(escaped_address),
+ escaped_safe_str(hostname));
+ tor_free(escaped_address);
} else if (count) {
log_warn(LD_EXIT, "eventdns returned only non-IPv4 answers for %s.",
escaped_safe_str(string_address));