diff options
author | Roger Dingledine <arma@torproject.org> | 2004-12-22 09:52:29 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-12-22 09:52:29 +0000 |
commit | 18320557a17188b7747116f1f4b51fc567e60f77 (patch) | |
tree | 9a63fe0cb8dc9cd5d25c59c2dab48299654f2fdb /src/or | |
parent | c3189c2573f25b10efe4c805e4ab85ca6ed9419c (diff) | |
download | tor-18320557a17188b7747116f1f4b51fc567e60f77.tar.gz tor-18320557a17188b7747116f1f4b51fc567e60f77.zip |
fix a crash: if you do socks4 with an IP of 0.0.0.x then we get tricked
into thinking you're doing socks4a, and we look for the next byte.
thanks to aphex for finding this.
svn:r3207
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/buffers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index aaff1df5cc..008babb488 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -584,6 +584,10 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { tor_assert(next < buf->mem+buf->datalen); startaddr = NULL; + if (socks4_prot == socks4a && next+1 == buf->mem+buf->datalen) { + log_fn(LOG_DEBUG,"socks4: No part of destaddr here yet."); + return 0; + } if (socks4_prot != socks4a && !have_warned_about_unsafe_socks) { log_fn(LOG_WARN,"Your application (using socks4 on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead.", req->port); // have_warned_about_unsafe_socks = 1; // (for now, warn every time) |