From e8d49b02e844b88d6bc7e7b84e85dd479bddc48d Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 4 Nov 2012 04:58:48 +0100 Subject: [PATCH] gethostbyaddr hook: also set aliases. i inspected behaviour of libc's and they all seem to set a valid h_aliases pointer, of which the first one should be NULL, if no aliases exist. --- src/libproxychains.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libproxychains.c b/src/libproxychains.c index 788a880..93355ae 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -400,6 +400,7 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) { static char buf[16]; static char ipv4[4]; static char *list[2]; + static char *aliases[1]; static struct hostent he; INIT(); @@ -419,7 +420,8 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) { list[1] = NULL; he.h_addr_list = list; he.h_addrtype = AF_INET; - he.h_aliases = NULL; + aliases[0] = NULL; + he.h_aliases = aliases; he.h_length = 4; pc_stringfromipv4((unsigned char *) addr, buf); return &he;