mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Fix spurious warning in bufferevent socks parsing
The problem was that we weren't initializing want_length to 0 before calling parse_socks() the first time, so it looked like we were risking an infinite loop when in fact we were safe. Fixes 3615; bugfix on 0.2.3.2-alpha.
This commit is contained in:
parent
c2d3da6303
commit
553ae5dfb5
3
changes/bug3615
Normal file
3
changes/bug3615
Normal file
@ -0,0 +1,3 @@
|
||||
o Minor bugfixes:
|
||||
- Fix a spurious warning when parsing SOCKS requests with
|
||||
bufferevents enabled. Fixes bug 3615; bugfix on 0.2.3.2-alpha.
|
@ -1581,12 +1581,12 @@ fetch_from_evbuffer_socks(struct evbuffer *buf, socks_request_t *req,
|
||||
*/
|
||||
struct evbuffer_iovec v;
|
||||
int i;
|
||||
want_length = evbuffer_get_contiguous_space(buf);
|
||||
n_drain = 0;
|
||||
i = evbuffer_peek(buf, want_length, NULL, &v, 1);
|
||||
i = evbuffer_peek(buf, -1, NULL, &v, 1);
|
||||
tor_assert(i == 1);
|
||||
data = v.iov_base;
|
||||
datalen = v.iov_len;
|
||||
want_length = 0;
|
||||
|
||||
res = parse_socks(data, datalen, req, log_sockstype,
|
||||
safe_socks, &n_drain, &want_length);
|
||||
|
Loading…
Reference in New Issue
Block a user