diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-19 20:40:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-19 20:40:15 -0400 |
commit | 553ae5dfb5f6bb49889b2b1735217dae803f92d7 (patch) | |
tree | aa29b37bb6cebb6bfb6cd7d45dd1b45e555c2a18 /src/or/buffers.c | |
parent | c2d3da6303a6a5e41eabcb18b56ee5d8434a9817 (diff) | |
download | tor-553ae5dfb5f6bb49889b2b1735217dae803f92d7.tar.gz tor-553ae5dfb5f6bb49889b2b1735217dae803f92d7.zip |
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.
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 256b507729..e2b0bd0e6f 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -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); |