mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
make our socks5 handling more robust to broken socks clients:
throw out everything waiting on the buffer in between socks handshake phases, since they can't possibly (so the theory goes) have predicted what we plan to respond to them. svn:r8223
This commit is contained in:
parent
9ebaf01096
commit
0649fa14c1
@ -953,7 +953,9 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
|
|||||||
req->reply[1] = '\xFF'; /* reject all methods */
|
req->reply[1] = '\xFF'; /* reject all methods */
|
||||||
return -1;
|
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->replylen = 2; /* 2 bytes of response */
|
||||||
req->reply[0] = 5; /* socks5 reply */
|
req->reply[0] = 5; /* socks5 reply */
|
||||||
|
Loading…
Reference in New Issue
Block a user