public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Reduce buffer size in get_console_process_id().
@ 2021-01-20  9:49 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-01-20  9:49 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5755870f7c369e0698409f0819e1730031b2740d

commit 5755870f7c369e0698409f0819e1730031b2740d
Author: Takashi Yano via Cygwin-patches <cygwin-patches@cygwin.com>
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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-20  9:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20  9:49 [newlib-cygwin] Cygwin: pty: Reduce buffer size in get_console_process_id() Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).