1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix out-of-bounds access in Windows CLI tools.

Commit c6ff548ae0 introduced this when not re-using an existing shared
connection.
This commit is contained in:
Jacob Nevins 2021-01-26 12:41:26 +00:00
parent fb130bf6da
commit aef7640bba

View File

@ -39,6 +39,7 @@ void cli_main_loop(cliloop_pre_t pre, cliloop_post_t post, void *ctx)
size_t extra_base = nhandles; size_t extra_base = nhandles;
if (winselcli_event != INVALID_HANDLE_VALUE) { if (winselcli_event != INVALID_HANDLE_VALUE) {
winselcli_index = extra_base++; winselcli_index = extra_base++;
handles = sresize(handles, extra_base, HANDLE);
handles[winselcli_index] = winselcli_event; handles[winselcli_index] = winselcli_event;
} }
size_t total_handles = extra_base + n_extra_handles; size_t total_handles = extra_base + n_extra_handles;