mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Fix use-after-free in banner handling.
When we fetch a chunk of data from the banner bufchain, we have to read from it _before_ calling bufchain_consume.
This commit is contained in:
parent
d1613e8147
commit
4adbd725ca
@ -509,9 +509,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
|
||||
while (bufchain_size(&s->banner) > 0) {
|
||||
ptrlen data = bufchain_prefix(&s->banner);
|
||||
seat_stderr_pl(s->ppl.seat, data);
|
||||
bufchain_consume(&s->banner, data.len);
|
||||
mid_line =
|
||||
(((const char *)data.ptr)[data.len-1] != '\n');
|
||||
bufchain_consume(&s->banner, data.len);
|
||||
}
|
||||
bufchain_clear(&s->banner);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user