aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 69cfd30d3..20fa700a0 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -953,7 +953,9 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
req->reply[1] = '\xFF'; /* reject all methods */
return -1;
}
- buf_remove_from_front(buf,2+nummethods); /* remove packet from buf */
+ /* remove packet from buf. also remove any other extraneous
+ * bytes, to support broken socks clients. */
+ buf_clear(buf);
req->replylen = 2; /* 2 bytes of response */
req->reply[0] = 5; /* socks5 reply */