Sebastian Kuschel reports that pfd_closing can be called for a socket master
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 15 Aug 2013 06:42:36 +0000 (06:42 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 15 Aug 2013 06:42:36 +0000 (06:42 +0000)
commit133ff7fb94934ff7857a23aea35892561968f1b7
tree7a99e7db23733c7705f409026a9b64974114b659
parentd27916ce6dc22fd1280edd4bc0c835d8f17b0581
Sebastian Kuschel reports that pfd_closing can be called for a socket
error with pr->c NULL, in which case calling sshfwd_unclean_close on
it will dereference NULL and segfault. Write an alternative error
handling path for that possibility.

(I don't know if it's the only way, but one way this can happen is if
you're doing dynamic forwarding and the socket error occurs during
SOCKS negotiation, in which case no SSH channel has been set up yet
because we haven't yet found out what we want to put in the
direct-tcpip channel open message.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@10018 cda61777-01e9-0310-a592-d414129be87e
portfwd.c