From aef7640bbae92e6d323f081e54828be654d332e9 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Tue, 26 Jan 2021 12:41:26 +0000 Subject: [PATCH] Fix out-of-bounds access in Windows CLI tools. Commit c6ff548ae0 introduced this when not re-using an existing shared connection. --- windows/wincliloop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/windows/wincliloop.c b/windows/wincliloop.c index d41c6e79..34b9a42e 100644 --- a/windows/wincliloop.c +++ b/windows/wincliloop.c @@ -39,6 +39,7 @@ void cli_main_loop(cliloop_pre_t pre, cliloop_post_t post, void *ctx) size_t extra_base = nhandles; if (winselcli_event != INVALID_HANDLE_VALUE) { winselcli_index = extra_base++; + handles = sresize(handles, extra_base, HANDLE); handles[winselcli_index] = winselcli_event; } size_t total_handles = extra_base + n_extra_handles;