mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
backport: Stop dnsworkers from triggering an assert failure when you
ask them to resolve the host "". svn:r2227
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
Changes in version 0.0.7.3 - 2004-08-12
|
||||
o Stop dnsworkers from triggering an assert failure when you
|
||||
ask them to resolve the host "".
|
||||
|
||||
|
||||
Changes in version 0.0.7.2 - 2004-07-07
|
||||
o A better fix for the 0.0.0.0 problem, that will hopefully
|
||||
eliminate the remaining related assertion failures.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
AC_INIT
|
||||
AM_INIT_AUTOMAKE(tor, 0.0.7.2)
|
||||
AM_INIT_AUTOMAKE(tor, 0.0.7.3)
|
||||
AM_CONFIG_HEADER(orconfig.h)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
@@ -1709,7 +1709,10 @@ int tor_lookup_hostname(const char *name, uint32_t *addr)
|
||||
struct in_addr iaddr;
|
||||
struct hostent *ent;
|
||||
tor_assert(addr);
|
||||
if (tor_inet_aton(name, &iaddr)) {
|
||||
if (!*name) {
|
||||
/* Empty address is an error. */
|
||||
return -1;
|
||||
} else if (tor_inet_aton(name, &iaddr)) {
|
||||
/* It's an IP. */
|
||||
memcpy(addr, &iaddr.s_addr, 4);
|
||||
return 0;
|
||||
|
||||
@@ -599,9 +599,8 @@ static int dnsworker_main(void *data) {
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user