1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Fix potential segfault in port forwarding code

[originally from svn r1184]
This commit is contained in:
Simon Tatham 2001-08-13 12:43:29 +00:00
parent 686740c2fb
commit f0d968ce49

View File

@ -248,8 +248,6 @@ void pfd_close(Socket s)
*/ */
void pfd_send(Socket s, char *data, int len) void pfd_send(Socket s, char *data, int len)
{ {
struct PFwdPrivate *pr = (struct PFwdPrivate *) sk_get_private_ptr(s);
if (s == NULL) if (s == NULL)
return; return;
@ -259,11 +257,12 @@ void pfd_send(Socket s, char *data, int len)
void pfd_confirm(Socket s) void pfd_confirm(Socket s)
{ {
struct PFwdPrivate *pr = (struct PFwdPrivate *) sk_get_private_ptr(s); struct PFwdPrivate *pr;
if (s == NULL) if (s == NULL)
return; return;
pr = (struct PFwdPrivate *) sk_get_private_ptr(s);
pr->ready = 1; pr->ready = 1;
sk_set_frozen(s, 0); sk_set_frozen(s, 0);
sk_write(s, NULL, 0); sk_write(s, NULL, 0);