From 3a5050bec2823554a348e86743b0cb76e13b46fb Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 20 Sep 2020 18:18:31 +0100 Subject: initialize allocator thread from get_chain_data if needed since we caved in to demands that it should be possible to allow hostnames in the proxy list section, we now got to deal with the fallout. the code was calling at_get... assuming that the allocator thread is always used. --- src/libproxychains.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libproxychains.c b/src/libproxychains.c index ad4809b..513351e 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -126,7 +126,9 @@ static int close_fds[16]; static int close_fds_cnt = 0; static void rdns_init(void) { - at_init(); + static int init_done = 0; + if(!init_done) at_init(); + init_done = 1; } static void do_init(void) { @@ -328,6 +330,7 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ if(1 != inet_pton(host_ip->is_v6 ? AF_INET6 : AF_INET, host, host_ip->addr.v6)) { if(*ct == STRICT_TYPE && proxychains_resolver && count > 0) { /* we can allow dns hostnames for all but the first proxy in the list if chaintype is strict, as remote lookup can be done */ + rdns_init(); ip_type4 internal_ip = at_get_ip_for_host(host, strlen(host)); pd[count].ip.is_v6 = 0; host_ip->addr.v4 = internal_ip; -- cgit v1.2.3