public inbox for
help / color / mirror / Atom feed
From: Corinna Vinschen <>
Subject: [newlib-cygwin] Cygwin: pty: Reduce buffer size in get_console_process_id().
Date: Wed, 20 Jan 2021 09:49:25 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);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.

 winsup/cygwin/ | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index c78e996e8..7f0752614 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -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)

                 reply	other threads:[~2021-01-20  9:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).