aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-29 17:29:33 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-29 17:29:33 -0400
commitee42fe8fbb85504ceef9335e2854c35e6163a8c3 (patch)
treeaa8ff3ddffe6e9bcb1a6d0b554e6b57235aee090 /src/or/buffers.c
parent2e6604f42ee614156ceeb29bdcab5c78cc1d84ba (diff)
downloadtor-ee42fe8fbb85504ceef9335e2854c35e6163a8c3.tar.gz
tor-ee42fe8fbb85504ceef9335e2854c35e6163a8c3.zip
Don't drain extra data when parsing socks auth methods
We added this back in 0649fa14 in 2006, to deal with the case where the client unconditionally sent us authentication data. Hopefully, that's not needed any longer, since we now can actually parse authentication data.
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 0e2dbbeb04..44a492addc 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1736,9 +1736,9 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
req->reply[1] = '\xFF'; /* reject all methods */
r=-1;
}
- /* remove packet from buf. also remove any other extraneous
- * bytes, to support broken socks clients. */
- *drain_out = -1;
+ /* Remove packet from buf. Some SOCKS clients will have sent extra
+ * junk at this point; let's hope it's an authentication message. */
+ *drain_out = 2u + nummethods;
return r;
}