From: Roger Dingledine Date: Mon, 12 Jul 2004 16:51:05 +0000 (+0000) Subject: fix a bug related to reading usernames for socks4 X-Git-Tag: tor-0.0.8pre1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=379768290e1bff32bd696174b22ceaef397ab400;p=thirdparty%2Ftor.git fix a bug related to reading usernames for socks4 this hasn't bitten us yet, but hey. svn:r2026 --- diff --git a/src/or/buffers.c b/src/or/buffers.c index 407b5f5a1d..661b1e1587 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -548,7 +548,8 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { socks4_prot = socks4; } - next = memchr(buf->mem+SOCKS4_NETWORK_LEN, 0, buf->datalen); + next = memchr(buf->mem+SOCKS4_NETWORK_LEN, 0, + buf->datalen-SOCKS4_NETWORK_LEN); if(!next) { log_fn(LOG_DEBUG,"socks4: Username not here yet."); return 0;