summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2023-07-24 10:18:53 -0400
committerDavid Goulet <dgoulet@torproject.org>2023-07-24 10:18:53 -0400
commit28dfa070698f0eafe1c26a3df3dcf96488ce6635 (patch)
treecdbe13a1731e0aaba14bb2a6c8586337ec708968 /src/core
parente6a9e006907cddf380d3c528757e1d41c4171884 (diff)
parentd6fd7d10352aae85ab5364efce6136b8b31108ca (diff)
downloadtor-28dfa070698f0eafe1c26a3df3dcf96488ce6635.tar.gz
tor-28dfa070698f0eafe1c26a3df3dcf96488ce6635.zip
Merge branch 'maint-0.4.7'
Diffstat (limited to 'src/core')
-rw-r--r--src/core/proto/proto_socks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/proto/proto_socks.c b/src/core/proto/proto_socks.c
index 07177c418a..78767a94ff 100644
--- a/src/core/proto/proto_socks.c
+++ b/src/core/proto/proto_socks.c
@@ -944,7 +944,7 @@ static const char SOCKS_PROXY_IS_NOT_AN_HTTP_PROXY_MSG[] =
* buffer should be cleared). Instead of pulling more data into the first
* chunk of the buffer, we set *<b>want_length_out</b> to the number of bytes
* we'd like to see in the input buffer, if they're available. */
-static int
+static socks_result_t
parse_socks(const char *data, size_t datalen, socks_request_t *req,
int log_sockstype, int safe_socks, size_t *drain_out)
{
@@ -952,7 +952,7 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
if (datalen < 2) {
/* We always need at least 2 bytes. */
- return 0;
+ return SOCKS_RESULT_TRUNCATED;
}
first_octet = get_uint8(data);
@@ -985,11 +985,11 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
escaped(tmp));
tor_free(tmp);
}
- return -1;
+ return SOCKS_RESULT_INVALID;
}
tor_assert_unreached();
- return -1;
+ return SOCKS_RESULT_INVALID;
}
/** Inspect a reply from SOCKS server stored in <b>buf</b> according