]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix a bug related to reading usernames for socks4
authorRoger Dingledine <arma@torproject.org>
Mon, 12 Jul 2004 16:51:05 +0000 (16:51 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 12 Jul 2004 16:51:05 +0000 (16:51 +0000)
this hasn't bitten us yet, but hey.

svn:r2026

src/or/buffers.c

index 407b5f5a1d4f5dd1f0ea59abf1f9eae4ed4f27df..661b1e158760fec8dd2d64b5d653be68ee26761c 100644 (file)
@@ -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;