public inbox for
help / color / mirror / Atom feed
From: Takashi Yano <>
Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: pty: Fix 'Bad address' error when running 'cmd.exe /c dir'
Date: Sat, 22 Oct 2022 05:34:55 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=08281cf4cca9593adcc3d30184322dc60fa1cd61

commit 08281cf4cca9593adcc3d30184322dc60fa1cd61
Author: Takashi Yano <>
Date:   Sat Oct 22 14:05:40 2022 +0900

    Cygwin: pty: Fix 'Bad address' error when running 'cmd.exe /c dir'
    - If the command executed is 'cmd.exe /c [...]', runpath in
      will be NULL. In this case, is_console_app(runpath) check causes
      access violation. This case also the command executed is obviously
      console app., therefore, treat it as console app to fix this issue.

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

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index d9d771651..972533554 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -198,6 +198,8 @@ handle (int fd, bool writing)
 static bool
 is_console_app (WCHAR *filename)
+  if (filename == NULL)
+    return true; /* The command executed is or cmd.exe. */
   HANDLE h;
   const int id_offset = 92;
   h = CreateFileW (filename, GENERIC_READ, FILE_SHARE_READ,

                 reply	other threads:[~2022-10-22  5:34 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).