[or-cvs] r8507: Fix for reverse dns: only assume we will get an answer when (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Sep 26 22:03:23 UTC 2006


Author: nickm
Date: 2006-09-26 18:03:23 -0400 (Tue, 26 Sep 2006)
New Revision: 8507

Modified:
   tor/trunk/
   tor/trunk/src/or/dns.c
Log:
 r8968 at 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r8968] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2006-09-25 22:34:27 UTC (rev 8506)
+++ tor/trunk/src/or/dns.c	2006-09-26 22:03:23 UTC (rev 8507)
@@ -861,8 +861,13 @@
   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;



More information about the tor-commits mailing list