|
@@ -1336,6 +1336,10 @@ log_unsafe_socks_warning(int socks_protocol, const char *address,
|
|
|
socks_protocol, address, (int)port);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * actually significantly higher than the longest possible socks message. */
|
|
|
+#define MAX_SOCKS_MESSAGE_LEN 512
|
|
|
+
|
|
|
|
|
|
* of the forms
|
|
|
* - socks4: "socksheader username\\0"
|
|
@@ -1377,7 +1381,7 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req,
|
|
|
if (buf->datalen < 2)
|
|
|
return 0;
|
|
|
|
|
|
- buf_pullup(buf, 128, 0);
|
|
|
+ buf_pullup(buf, MAX_SOCKS_MESSAGE_LEN, 0);
|
|
|
tor_assert(buf->head && buf->head->datalen >= 2);
|
|
|
|
|
|
socksver = *buf->head->data;
|