tCrash on SOCKS4 connect under Win32 fixed - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d3d2f0f75126492241714d9a513c93518441e688
(DIR) parent 54cc013c3914c5d150e0d36072c834d2223065bd
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Fri, 12 Oct 2001 21:57:29 +0000
Crash on SOCKS4 connect under Win32 fixed
Diffstat:
M src/network.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/network.c b/src/network.c
t@@ -826,7 +826,7 @@ gboolean StartSocksNegotiation(NetworkBuffer *NetBuf,gchar *RemoteHost,
struct hostent *he;
guchar *addpt;
guint addlen,i;
- struct in_addr *h_addr;
+ struct in_addr *haddr;
unsigned short int netport;
#ifdef CYGWIN
gchar *username=NULL;
t@@ -892,7 +892,7 @@ g_print("username %s\n",pwd->pw_name);
addlen=9+strlen(pwd->pw_name);
#endif
- h_addr = (struct in_addr *)he->h_addr;
+ haddr = (struct in_addr *)he->h_addr;
g_assert(sizeof(struct in_addr)==4);
netport = htons(RemotePort);
t@@ -904,10 +904,11 @@ g_print("username %s\n",pwd->pw_name);
return FALSE;
}
+
addpt[0] = 4; /* SOCKS version */
addpt[1] = 1; /* CONNECT */
memcpy(&addpt[2],&netport,sizeof(netport));
- memcpy(&addpt[4],h_addr,sizeof(struct in_addr));
+ memcpy(&addpt[4],haddr,sizeof(struct in_addr));
#ifdef CYGWIN
strcpy(&addpt[8],username);
g_free(username);