mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
The latest unfix.org IPv6 patch contains these apparently
IPv6-unrelated changes, which convert ints into unsigned in a few key places in ssh.c. Looks harmless at worst, possibly terribly useful, so I think we'll have these no matter what the real IPv6 stuff is up to! [originally from svn r5038]
This commit is contained in:
parent
340afa2733
commit
6120d91507
12
ssh.c
12
ssh.c
@ -4185,7 +4185,7 @@ static void ssh1_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
/* Data sent down one of our channels. */
|
/* Data sent down one of our channels. */
|
||||||
int i = ssh_pkt_getuint32(pktin);
|
int i = ssh_pkt_getuint32(pktin);
|
||||||
char *p;
|
char *p;
|
||||||
int len;
|
unsigned int len;
|
||||||
struct ssh_channel *c;
|
struct ssh_channel *c;
|
||||||
|
|
||||||
ssh_pkt_getstring(pktin, &p, &len);
|
ssh_pkt_getstring(pktin, &p, &len);
|
||||||
@ -4204,7 +4204,7 @@ static void ssh1_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
/* Data for an agent message. Buffer it. */
|
/* Data for an agent message. Buffer it. */
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
if (c->u.a.lensofar < 4) {
|
if (c->u.a.lensofar < 4) {
|
||||||
int l = min(4 - c->u.a.lensofar, len);
|
unsigned int l = min(4 - c->u.a.lensofar, len);
|
||||||
memcpy(c->u.a.msglen + c->u.a.lensofar, p,
|
memcpy(c->u.a.msglen + c->u.a.lensofar, p,
|
||||||
l);
|
l);
|
||||||
p += l;
|
p += l;
|
||||||
@ -4219,7 +4219,7 @@ static void ssh1_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
memcpy(c->u.a.message, c->u.a.msglen, 4);
|
memcpy(c->u.a.message, c->u.a.msglen, 4);
|
||||||
}
|
}
|
||||||
if (c->u.a.lensofar >= 4 && len > 0) {
|
if (c->u.a.lensofar >= 4 && len > 0) {
|
||||||
int l =
|
unsigned int l =
|
||||||
min(c->u.a.totallen - c->u.a.lensofar,
|
min(c->u.a.totallen - c->u.a.lensofar,
|
||||||
len);
|
len);
|
||||||
memcpy(c->u.a.message + c->u.a.lensofar, p,
|
memcpy(c->u.a.message + c->u.a.lensofar, p,
|
||||||
@ -5335,7 +5335,7 @@ static void ssh2_msg_channel_window_adjust(Ssh ssh, struct Packet *pktin)
|
|||||||
static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
||||||
{
|
{
|
||||||
char *data;
|
char *data;
|
||||||
int length;
|
unsigned int length;
|
||||||
unsigned i = ssh_pkt_getuint32(pktin);
|
unsigned i = ssh_pkt_getuint32(pktin);
|
||||||
struct ssh_channel *c;
|
struct ssh_channel *c;
|
||||||
c = find234(ssh->channels, &i, ssh_channelfind);
|
c = find234(ssh->channels, &i, ssh_channelfind);
|
||||||
@ -5364,7 +5364,7 @@ static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
case CHAN_AGENT:
|
case CHAN_AGENT:
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
if (c->u.a.lensofar < 4) {
|
if (c->u.a.lensofar < 4) {
|
||||||
int l = min(4 - c->u.a.lensofar, length);
|
unsigned int l = min(4 - c->u.a.lensofar, length);
|
||||||
memcpy(c->u.a.msglen + c->u.a.lensofar,
|
memcpy(c->u.a.msglen + c->u.a.lensofar,
|
||||||
data, l);
|
data, l);
|
||||||
data += l;
|
data += l;
|
||||||
@ -5379,7 +5379,7 @@ static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
|
|||||||
memcpy(c->u.a.message, c->u.a.msglen, 4);
|
memcpy(c->u.a.message, c->u.a.msglen, 4);
|
||||||
}
|
}
|
||||||
if (c->u.a.lensofar >= 4 && length > 0) {
|
if (c->u.a.lensofar >= 4 && length > 0) {
|
||||||
int l =
|
unsigned int l =
|
||||||
min(c->u.a.totallen - c->u.a.lensofar,
|
min(c->u.a.totallen - c->u.a.lensofar,
|
||||||
length);
|
length);
|
||||||
memcpy(c->u.a.message + c->u.a.lensofar,
|
memcpy(c->u.a.message + c->u.a.lensofar,
|
||||||
|
Loading…
Reference in New Issue
Block a user