From f85cecdabea90db31dc2891c404ccee4bc655354 Mon Sep 17 00:00:00 2001 From: Alexander Batischev Date: Mon, 1 Feb 2016 20:58:59 +0300 Subject: [PATCH] Fix bug in hostsreader hostsreader_get() used to assign the IP address to both `name` and `ip` fields in `struct hostsreader`, which led to proxychains effectively ignoring the contents of /etc/hosts. --- src/hostsreader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostsreader.c b/src/hostsreader.c index 6589f9f..2e6a4f1 100644 --- a/src/hostsreader.c +++ b/src/hostsreader.c @@ -44,7 +44,7 @@ int hostsreader_get(struct hostsreader *ctx, char* buf, size_t bufsize) { l--; } if(!l || !*p) continue; - ctx->name = buf; + ctx->name = p; while(*p && !isspace(*p) && l) { p++; l--;