* [PATCH] Cygwin: pty: Fix crash on master close in Windows 7.
@ 2022-03-30 3:56 Takashi Yano
0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-03-30 3:56 UTC (permalink / raw)
To: cygwin-patches
- The 4th parameter of WriteFile() cannot be NULL especially in
Windows 7 as mentioned in Microsoft documentation. This patch
fixes that.
Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251162.html
---
winsup/cygwin/fhandler_tty.cc | 2 +-
winsup/cygwin/release/3.3.5 | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index e29b93ceb..4cb5f1411 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -2106,7 +2106,7 @@ fhandler_pty_master::close ()
}
release_output_mutex ();
get_ttyp ()->stop_fwd_thread = true;
- WriteFile (to_master_nat, "", 0, NULL, NULL);
+ WriteFile (to_master_nat, "", 0, &len, NULL);
master_fwd_thread->detach ();
}
}
diff --git a/winsup/cygwin/release/3.3.5 b/winsup/cygwin/release/3.3.5
index d2a7f772a..9d44c1b79 100644
--- a/winsup/cygwin/release/3.3.5
+++ b/winsup/cygwin/release/3.3.5
@@ -43,3 +43,6 @@ Bug Fixes
- Fix a formatting problem in gmondump where all displayed addresses are
mistakenly prefixed with "0x0x".
+
+- Fix crash on pty master close in Windows 7.
+ Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251162.html
--
2.35.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-30 3:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 3:56 [PATCH] Cygwin: pty: Fix crash on master close in Windows 7 Takashi Yano
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).