From 25a7765aed9e146ddf9ce79f8248bd2666c4dd1b Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 1 Jul 2014 18:57:57 +0200 Subject: [PATCH] Don't pad the text address with the binary form The buf gets copied to hostname and is present verbatim in logs looking like pure random garbage. Moreover you can't really strlen() it. This was likely some silly typo in inet_ntoa -> inet_ntop conversion for ipv6, since it used to be correct before. --- src/socks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socks.c b/src/socks.c index 6cdff57..1fe8a95 100644 --- a/src/socks.c +++ b/src/socks.c @@ -100,7 +100,7 @@ void * sockschild(struct clientparam* param) { if(command==1 && !param->req.sin_addr.s_addr) { RETURN(422); } - myinet_ntop(*SAFAMILY(¶m->sins), SAADDR(¶m->sins), (char *)buf + strlen((char *)buf), 64); + myinet_ntop(*SAFAMILY(¶m->sins), SAADDR(¶m->sins), (char *)buf, 64); break; case 3: if ((size = sockgetcharcli(param, conf.timeouts[SINGLEBYTE_S], 0)) == EOF) {RETURN(451);} /* nmethods */