mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Check ssh->v2_session_id_len _after_ assigning to it.
[originally from svn r6260]
This commit is contained in:
parent
27fc5e518f
commit
d628d14e7f
2
ssh.c
2
ssh.c
@ -5602,8 +5602,8 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen,
|
|||||||
assert(sizeof(s->exchange_hash) <= sizeof(ssh->v2_session_id));
|
assert(sizeof(s->exchange_hash) <= sizeof(ssh->v2_session_id));
|
||||||
memcpy(ssh->v2_session_id, s->exchange_hash,
|
memcpy(ssh->v2_session_id, s->exchange_hash,
|
||||||
sizeof(s->exchange_hash));
|
sizeof(s->exchange_hash));
|
||||||
assert(ssh->v2_session_id_len <= sizeof(ssh->v2_session_id));
|
|
||||||
ssh->v2_session_id_len = ssh->kex->hash->hlen;
|
ssh->v2_session_id_len = ssh->kex->hash->hlen;
|
||||||
|
assert(ssh->v2_session_id_len <= sizeof(ssh->v2_session_id));
|
||||||
s->got_session_id = TRUE;
|
s->got_session_id = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user