X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ssh.c;h=0435dd7ec25373c3b02affcad1bd9960bc6192a4;hb=8316deb3399fe1d0c406132cf2e795a76de26b64;hp=7df67eb81234deb1112d24e9e69daa1802447ecd;hpb=775fe9eb3188c4180265e2f6a92cb47f966e3e07;p=PuTTY.git diff --git a/ssh.c b/ssh.c index 7df67eb8..0435dd7e 100644 --- a/ssh.c +++ b/ssh.c @@ -2933,6 +2933,7 @@ static int do_ssh1_login(Ssh ssh, unsigned char *in, int inlen, if (s->dlgret == 0) { ssh->close_expected = TRUE; ssh_closing((Plug)ssh, NULL, 0, 0); + crStop(0); } } @@ -3013,6 +3014,7 @@ static int do_ssh1_login(Ssh ssh, unsigned char *in, int inlen, if (s->dlgret == 0) { ssh->close_expected = TRUE; ssh_closing((Plug)ssh, NULL, 0, 0); + crStop(0); } } } @@ -3909,7 +3911,7 @@ static void ssh_setup_portfwd(Ssh ssh, const Config *cfg) strcpy(saddr, sports); n = 0; } - if (n < 255) sports[n++] = *portfwd_strptr++; + if (n < lenof(sports)-1) sports[n++] = *portfwd_strptr++; } sports[n] = 0; if (type != 'D') { @@ -3917,14 +3919,14 @@ static void ssh_setup_portfwd(Ssh ssh, const Config *cfg) portfwd_strptr++; n = 0; while (*portfwd_strptr && *portfwd_strptr != ':') { - if (n < 255) host[n++] = *portfwd_strptr++; + if (n < lenof(host)-1) host[n++] = *portfwd_strptr++; } host[n] = 0; if (*portfwd_strptr == ':') portfwd_strptr++; n = 0; while (*portfwd_strptr) { - if (n < 255) dports[n++] = *portfwd_strptr++; + if (n < lenof(dports)-1) dports[n++] = *portfwd_strptr++; } dports[n] = 0; portfwd_strptr++;