From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id AA91E3840C27; Wed, 20 Jan 2021 09:49:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA91E3840C27 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Reduce buffer size in get_console_process_id(). X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: 62e739b51bb1cbe644470c40ca414d8a2ea34c18 X-Git-Newrev: 5755870f7c369e0698409f0819e1730031b2740d Message-Id: <20210120094925.AA91E3840C27@sourceware.org> Date: Wed, 20 Jan 2021 09:49:25 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 09:49:25 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5755870f7c369e0698409f0819e1730031b2740d commit 5755870f7c369e0698409f0819e1730031b2740d Author: Takashi Yano via Cygwin-patches Date: Wed Jan 20 09:57:00 2021 +0900 Cygwin: pty: Reduce buffer size in get_console_process_id(). - The buffer used in get_console_process_id(), introduced by commit 72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7. Therefore, the buffer size has been reduced. Diff: --- winsup/cygwin/fhandler_tty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index c78e996e8..7f0752614 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -65,8 +65,8 @@ static DWORD get_console_process_id (DWORD pid, bool match) { tmp_pathbuf tp; - DWORD *list = (DWORD *) tp.w_get (); - const DWORD buf_size = NT_MAX_PATH * sizeof (WCHAR) / sizeof (DWORD); + DWORD *list = (DWORD *) tp.c_get (); + const DWORD buf_size = NT_MAX_PATH / sizeof (DWORD); DWORD num = GetConsoleProcessList (list, buf_size); if (num == 0 || num > buf_size)