1
0
mirror of https://github.com/rofl0r/proxychains-ng synced 2025-01-06 21:02:55 +08:00

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.
This commit is contained in:
rofl0r 2020-10-26 02:53:29 +00:00
parent 7fe8139496
commit c99d97983e
2 changed files with 2 additions and 2 deletions

View File

@ -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];

View File

@ -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);