diff options
-rw-r--r-- | src/tools/tor-resolve.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c index 5481ad0c42..40fd749d68 100644 --- a/src/tools/tor-resolve.c +++ b/src/tools/tor-resolve.c @@ -137,6 +137,10 @@ do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport, len = 0; while (len < RESPONSE_LEN) { r = recv(s, response_buf+len, RESPONSE_LEN-len, 0); + if (r==0) { + log_fn(LOG_WARN,"EOF while reading SOCKS response"); + return -1; + } if (r<0) { log_sock_error("reading SOCKS response", s); return -1; |