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
path: root/src
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-10-26 05:53:29 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2020-10-26 05:53:29 +0300
commitc99d97983e66e80869416f010b6730ca98de8b01 (patch)
treea1152e1c3d3637e2633f0830f4fc8e7b1e5762c2 /src
parent7fe813949644b115b0127279517dc7c0ee2d63b9 (diff)
shrink huge gethostbyname buffer
careful analysis has shown that the buffer is only ever used for at most a single hostname, so 256 bytes are sufficient. the huge 8KB buffer caused stack overflow when used with microsocks, which defaults to tiny thread stacks of 8KB with musl libc.
Diffstat (limited to 'src')
-rw-r--r--src/core.c2
-rw-r--r--src/core.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index c307cbe..f5e7ce9 100644
--- a/src/core.c
+++ b/src/core.c
@@ -749,7 +749,7 @@ struct hostent* proxy_gethostbyname_old(const char *name)
static struct hostent hostent_space;
static in_addr_t resolved_addr;
static char* resolved_addr_p;
- static char addr_name[1024*8];
+ static char addr_name[256];
int pipe_fd[2];
char buff[256];
diff --git a/src/core.h b/src/core.h
index d54806d..acb0152 100644
--- a/src/core.h
+++ b/src/core.h
@@ -117,7 +117,7 @@ struct gethostbyname_data {
struct hostent hostent_space;
in_addr_t resolved_addr;
char *resolved_addr_p[2];
- char addr_name[1024 * 8];
+ char addr_name[256];
};
struct hostent* proxy_gethostbyname(const char *name, struct gethostbyname_data *data);