Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2022-10-22 08:05:40 +0300
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-10-22 08:19:01 +0300
commit08281cf4cca9593adcc3d30184322dc60fa1cd61 (patch)
tree09c030aa2677ba6d099e3668047cffa324e0fc37
parent1ca46b22d6edb3d469b51475e8b096d86deaac67 (diff)
Cygwin: pty: Fix 'Bad address' error when running 'cmd.exe /c dir'cygwin-3_3-branch
- If the command executed is 'cmd.exe /c [...]', runpath in spawn.cc 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. Addresses: https://github.com/msys2/msys2-runtime/issues/108
-rw-r--r--winsup/cygwin/spawn.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index d9d771651..972533554 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -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 command.com or cmd.exe. */
HANDLE h;
const int id_offset = 92;
h = CreateFileW (filename, GENERIC_READ, FILE_SHARE_READ,