From 1d1b09b75b8326049a0ad9912e797454082d4f5d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 25 Jan 2010 04:00:08 +0000 Subject: [PATCH] (trunk libT) #2804 "segmentation fault add-by-url when url scheme is ftp" -- fixed in trunk for 1.83 --- libtransmission/web.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libtransmission/web.c b/libtransmission/web.c index 32db3da6b..0fbbba694 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -375,7 +375,9 @@ dns_ipv4_done_cb( int err, char type, int count, int ttl, void * addresses, void /* FIXME: if count > 1, is there a way to decide which is best to use? */ } - if( task->resolved_host || evdns_resolve_ipv6( task->host, 0, dns_ipv6_done_cb, task ) ) + if( ( task->resolved_host != NULL ) + || ( task->host == NULL ) + || evdns_resolve_ipv6( task->host, 0, dns_ipv6_done_cb, task ) ) dns_ipv6_done_cb( DNS_ERR_UNKNOWN, DNS_IPv6_AAAA, 0, 0, NULL, task ); } @@ -394,7 +396,9 @@ doDNS( void * vtask ) task->resolved_host = dns_get_cached_host( task, host ); } - if( task->resolved_host || evdns_resolve_ipv4( host, 0, dns_ipv4_done_cb, task ) ) + if( ( task->resolved_host != NULL ) + || ( host == NULL ) + || evdns_resolve_ipv4( host, 0, dns_ipv4_done_cb, task ) ) dns_ipv4_done_cb( DNS_ERR_UNKNOWN, DNS_IPv4_A, 0, 0, NULL, task ); }