mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 20:42:48 -05:00
Merge branch 'pre-0.67'
This commit is contained in:
27
ssh.c
27
ssh.c
@ -5562,7 +5562,7 @@ static void ssh1_msg_port_open(Ssh ssh, struct Packet *pktin)
|
||||
ssh_pkt_getstring(pktin, &host, &hostsize);
|
||||
port = ssh_pkt_getuint32(pktin);
|
||||
|
||||
pf.dhost = dupprintf("%.*s", hostsize, host);
|
||||
pf.dhost = dupprintf("%.*s", hostsize, NULLTOEMPTY(host));
|
||||
pf.dport = port;
|
||||
pfp = find234(ssh->rportfwds, &pf, NULL);
|
||||
|
||||
@ -6045,7 +6045,7 @@ static void ssh1_msg_debug(Ssh ssh, struct Packet *pktin)
|
||||
int msglen;
|
||||
|
||||
ssh_pkt_getstring(pktin, &msg, &msglen);
|
||||
logeventf(ssh, "Remote debug message: %.*s", msglen, msg);
|
||||
logeventf(ssh, "Remote debug message: %.*s", msglen, NULLTOEMPTY(msg));
|
||||
}
|
||||
|
||||
static void ssh1_msg_disconnect(Ssh ssh, struct Packet *pktin)
|
||||
@ -6055,7 +6055,8 @@ static void ssh1_msg_disconnect(Ssh ssh, struct Packet *pktin)
|
||||
int msglen;
|
||||
|
||||
ssh_pkt_getstring(pktin, &msg, &msglen);
|
||||
bombout(("Server sent disconnect message:\n\"%.*s\"", msglen, msg));
|
||||
bombout(("Server sent disconnect message:\n\"%.*s\"",
|
||||
msglen, NULLTOEMPTY(msg)));
|
||||
}
|
||||
|
||||
static void ssh_msg_ignore(Ssh ssh, struct Packet *pktin)
|
||||
@ -8264,7 +8265,8 @@ static void ssh2_msg_channel_open_failure(Ssh ssh, struct Packet *pktin)
|
||||
reason_code = 0; /* ensure reasons[reason_code] in range */
|
||||
ssh_pkt_getstring(pktin, &reason_string, &reason_length);
|
||||
logeventf(ssh, "Forwarded connection refused by server: %s [%.*s]",
|
||||
reasons[reason_code], reason_length, reason_string);
|
||||
reasons[reason_code], reason_length,
|
||||
NULLTOEMPTY(reason_string));
|
||||
|
||||
pfd_close(c->u.pfd.pf);
|
||||
} else if (c->type == CHAN_ZOMBIE) {
|
||||
@ -8560,9 +8562,7 @@ static void ssh2_msg_channel_open(Ssh ssh, struct Packet *pktin)
|
||||
char *addrstr;
|
||||
|
||||
ssh_pkt_getstring(pktin, &peeraddr, &peeraddrlen);
|
||||
addrstr = snewn(peeraddrlen+1, char);
|
||||
memcpy(addrstr, peeraddr, peeraddrlen);
|
||||
addrstr[peeraddrlen] = '\0';
|
||||
addrstr = dupprintf("%.*s", peeraddrlen, NULLTOEMPTY(peeraddr));
|
||||
peerport = ssh_pkt_getuint32(pktin);
|
||||
|
||||
logeventf(ssh, "Received X11 connect request from %s:%d",
|
||||
@ -8597,13 +8597,14 @@ static void ssh2_msg_channel_open(Ssh ssh, struct Packet *pktin)
|
||||
char *shost;
|
||||
int shostlen;
|
||||
ssh_pkt_getstring(pktin, &shost, &shostlen);/* skip address */
|
||||
pf.shost = dupprintf("%.*s", shostlen, shost);
|
||||
pf.shost = dupprintf("%.*s", shostlen, NULLTOEMPTY(shost));
|
||||
pf.sport = ssh_pkt_getuint32(pktin);
|
||||
ssh_pkt_getstring(pktin, &peeraddr, &peeraddrlen);
|
||||
peerport = ssh_pkt_getuint32(pktin);
|
||||
realpf = find234(ssh->rportfwds, &pf, NULL);
|
||||
logeventf(ssh, "Received remote port %s:%d open request "
|
||||
"from %s:%d", pf.shost, pf.sport, peeraddr, peerport);
|
||||
"from %.*s:%d", pf.shost, pf.sport,
|
||||
peeraddrlen, NULLTOEMPTY(peeraddr), peerport);
|
||||
sfree(pf.shost);
|
||||
|
||||
if (realpf == NULL) {
|
||||
@ -10267,7 +10268,7 @@ static void do_ssh2_authconn(Ssh ssh, const unsigned char *in, int inlen,
|
||||
s->cur_prompt->to_server = TRUE;
|
||||
s->cur_prompt->name = dupstr("New SSH password");
|
||||
s->cur_prompt->instruction =
|
||||
dupprintf("%.*s", prompt_len, prompt);
|
||||
dupprintf("%.*s", prompt_len, NULLTOEMPTY(prompt));
|
||||
s->cur_prompt->instr_reqd = TRUE;
|
||||
/*
|
||||
* There's no explicit requirement in the protocol
|
||||
@ -10705,13 +10706,13 @@ static void ssh2_msg_disconnect(Ssh ssh, struct Packet *pktin)
|
||||
logevent(buf);
|
||||
sfree(buf);
|
||||
buf = dupprintf("Disconnection message text: %.*s",
|
||||
msglen, msg);
|
||||
msglen, NULLTOEMPTY(msg));
|
||||
logevent(buf);
|
||||
bombout(("Server sent disconnect message\ntype %d (%s):\n\"%.*s\"",
|
||||
reason,
|
||||
(reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ?
|
||||
ssh2_disconnect_reasons[reason] : "unknown",
|
||||
msglen, msg));
|
||||
msglen, NULLTOEMPTY(msg)));
|
||||
sfree(buf);
|
||||
}
|
||||
|
||||
@ -10725,7 +10726,7 @@ static void ssh2_msg_debug(Ssh ssh, struct Packet *pktin)
|
||||
ssh2_pkt_getbool(pktin);
|
||||
ssh_pkt_getstring(pktin, &msg, &msglen);
|
||||
|
||||
logeventf(ssh, "Remote debug message: %.*s", msglen, msg);
|
||||
logeventf(ssh, "Remote debug message: %.*s", msglen, NULLTOEMPTY(msg));
|
||||
}
|
||||
|
||||
static void ssh2_msg_transport(Ssh ssh, struct Packet *pktin)
|
||||
|
Reference in New Issue
Block a user