From 08d6feace80ef0b83bc9ce6c7d933ad00c6f0dae Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 7 Nov 2011 00:09:46 +0100 Subject: [PATCH] fix SOCKSv4a --- src/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index e7fe50c..423fe93 100644 --- a/src/core.c +++ b/src/core.c @@ -342,7 +342,10 @@ static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt,ch memcpy(&buff[4], &ip, 4); // dest host len = ulen + 1; // username if(len > 1) - memcpy(&buff[8], user, ulen + 1); + memcpy(&buff[8], user, len); + else { + buff[8] = 0; + } // do socksv4a dns resolution on the server if(dns_len) {