Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-10-26 06:03:08 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2020-10-26 06:03:08 +0300
commit486f8200ad9ab5c0726f021912cff09a6a21261c (patch)
treeb43933883ee9161439c741fd395e5926bd894d73
parentc99d97983e66e80869416f010b6730ca98de8b01 (diff)
tunnel_to: shrink huge buffer size
the buffer buff was only used for the initial handshake packets, which in all supported protocols are usual less than a 100 bytes, with user/pass and dns name at maximum we'd require 768 bytes, which still leaves us a formidable 256 bytes for the rest of the packet. this fixes a segfault with microsocks which on musl uses tiny thread stack sizes of 8KB.
-rw-r--r--src/core.c1
-rw-r--r--src/core.h1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index f5e7ce9..4226a7e 100644
--- a/src/core.c
+++ b/src/core.c
@@ -188,6 +188,7 @@ static int timed_connect(int sock, const struct sockaddr *addr, socklen_t len) {
#define INVALID_INDEX 0xFFFFFFFFU
+#define BUFF_SIZE 1024 // used to read responses from proxies.
static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt, char *user, char *pass) {
char *dns_name = NULL;
char hostnamebuf[MSG_LEN_MAX];
diff --git a/src/core.h b/src/core.h
index acb0152..fd9b6c8 100644
--- a/src/core.h
+++ b/src/core.h
@@ -23,7 +23,6 @@
#ifndef __CORE_HEADER
#define __CORE_HEADER
-#define BUFF_SIZE 8*1024 // used to read responses from proxies.
#define MAX_LOCALNET 64
#define MAX_DNAT 64