Tartarus CVS: putty: jacob
tartarus-commits@lists.tartarus.org
tartarus-commits@lists.tartarus.org
Thu, 07 Aug 2003 17:04:35 +0100
CVS Root: /usr/data/cvs
Module: putty
Changes by: jacob
Date: Thu Aug 07 2003 17:04:35 BST
Log message:
Control of 'addr' is now handed over to {platform_,}new_connection() and
sk_new() on invocation; these functions become responsible for (eventually)
freeing it. The caller must not do anything with 'addr' after it's been passed
in. (Ick.)
Why:
A SOCKS5 crash appears to have been caused by overzealous freeing of a SockAddr
(ssh.c:1.257), which for proxied connections is squirreled away long-term (and
this can't easily be avoided).
It would have been nice to make a copy of the SockAddr, in case the caller has
a use for it, but one of the implementations (uxnet.c) hides a "struct
addrinfo" in there, and we have no defined way to duplicate those. (None of the
current callers _do_ have a further use for the SockAddr.)
As far as I can tell, everything _except_ proxying only needs addr for the
duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it
should at least be easier to find the offending free()...
Modified files:
. : network.h portfwd.c proxy.c raw.c rlogin.c ssh.c
telnet.c winnet.c x11fwd.c
mac : mtcpnet.c otnet.c
unix : uxnet.c uxproxy.c
Links:
http://cvs.tartarus.org//putty/network.h.diff?r1=1.25&r2=1.26
http://cvs.tartarus.org//putty/portfwd.c.diff?r1=1.23&r2=1.24
http://cvs.tartarus.org//putty/proxy.c.diff?r1=1.37&r2=1.38
http://cvs.tartarus.org//putty/raw.c.diff?r1=1.48&r2=1.49
http://cvs.tartarus.org//putty/rlogin.c.diff?r1=1.44&r2=1.45
http://cvs.tartarus.org//putty/ssh.c.diff?r1=1.299&r2=1.300
http://cvs.tartarus.org//putty/telnet.c.diff?r1=1.68&r2=1.69
http://cvs.tartarus.org//putty/winnet.c.diff?r1=1.52&r2=1.53
http://cvs.tartarus.org//putty/x11fwd.c.diff?r1=1.33&r2=1.34
http://cvs.tartarus.org//putty/mac/mtcpnet.c.diff?r1=1.19&r2=1.20
http://cvs.tartarus.org//putty/mac/otnet.c.diff?r1=1.11&r2=1.12
http://cvs.tartarus.org//putty/unix/uxnet.c.diff?r1=1.20&r2=1.21
http://cvs.tartarus.org//putty/unix/uxproxy.c.diff?r1=1.1&r2=1.2