X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/fab893b6cac31863187aed38740cb302a3c42193..5e391f65bf316164b139e836a9417d46090a71b7:/portfwd.c diff --git a/portfwd.c b/portfwd.c index 8ef1761b..e21ed3a2 100644 --- a/portfwd.c +++ b/portfwd.c @@ -220,7 +220,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len) } if (pr->dynamic == 0x5001) { - int atype, alen; + int atype, alen = 0; if (pr->port < 6) continue; atype = (unsigned char)pr->hostname[3]; if (atype == 1) /* IPv4 address */ @@ -362,6 +362,7 @@ char *pfd_newconnect(Socket *s, char *hostname, int port, void *c, pr->ready = 1; pr->c = c; pr->backhandle = NULL; /* we shouldn't need this */ + pr->dynamic = 0; pr->s = *s = new_connection(addr, dummy_realhost, port, 0, 1, 0, (Plug) pr, cfg); @@ -415,6 +416,7 @@ static int pfd_accepting(Plug p, void *sock) pr->port = 0; /* hostname buffer is so far empty */ sk_set_frozen(s, 0); /* we want to receive SOCKS _now_! */ } else { + pr->dynamic = 0; strcpy(pr->hostname, org->hostname); pr->port = org->port; pr->c = new_sock_channel(org->backhandle, s);