[or-cvs] Fix bug reported by peter palfrader: an empty address is un...

Nick Mathewson nickm at seul.org
Tue Jul 6 23:25:23 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv5571/src/or

Modified Files:
	dns.c 
Log Message:
Fix bug reported by peter palfrader: an empty address is unresolvable, but not an occasion for an assertion failure in a dnsworker.

Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dns.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- dns.c	4 Jul 2004 04:52:43 -0000	1.101
+++ dns.c	6 Jul 2004 23:25:21 -0000	1.102
@@ -648,9 +648,8 @@
       log_fn(LOG_INFO,"dnsworker exiting because tor process died.");
       spawn_exit();
     }
-    tor_assert(address_len > 0);
 
-    if(read_all(fd, address, address_len, 1) != address_len) {
+    if(address_len && read_all(fd, address, address_len, 1) != address_len) {
       log_fn(LOG_ERR,"read hostname failed. Child exiting.");
       spawn_exit();
     }



More information about the tor-commits mailing list