From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 74EFD3858C50; Wed, 30 Mar 2022 03:57:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74EFD3858C50 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Fix crash on master close in Windows 7. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: be9c0561e7da91b2d5c589a43f9c0fea1e684f2d X-Git-Newrev: 49a00a0673e7318f7f27719ab2f0ac8eb3c6b439 Message-Id: <20220330035744.74EFD3858C50@sourceware.org> Date: Wed, 30 Mar 2022 03:57:44 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 03:57:44 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D49a00a0673e= 7318f7f27719ab2f0ac8eb3c6b439 commit 49a00a0673e7318f7f27719ab2f0ac8eb3c6b439 Author: Takashi Yano Date: Wed Mar 30 12:46:08 2022 +0900 Cygwin: pty: Fix crash on master close in Windows 7. =20 - The 4th parameter of WriteFile() cannot be NULL especially in Windows 7 as mentioned in Microsoft documentation. This patch fixes that. =20 Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251162.html Diff: --- 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 =3D 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 =20 - 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