Browse Source

fix a bug related to reading usernames for socks4
this hasn't bitten us yet, but hey.


svn:r2026

Roger Dingledine 21 years ago
parent
commit
379768290e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/or/buffers.c

+ 2 - 1
src/or/buffers.c

@@ -548,7 +548,8 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) {
         socks4_prot = socks4;
         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) {
       if(!next) {
         log_fn(LOG_DEBUG,"socks4: Username not here yet.");
         log_fn(LOG_DEBUG,"socks4: Username not here yet.");
         return 0;
         return 0;