]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: pty: Fix crash on master close in Windows 7.
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Wed, 30 Mar 2022 03:46:08 +0000 (12:46 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Wed, 30 Mar 2022 03:46:08 +0000 (12:46 +0900)
- 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
winsup/cygwin/release/3.3.5

index e29b93ceba9e502b5cede7315b002ec67a57a2da..4cb5f1411bbee113404fba873f30da7534d2e78c 100644 (file)
@@ -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 ();
        }
     }
index d2a7f772a41d03971bdbd4e43ac8fd5c9a963d9a..9d44c1b79988a323498ce104999f849e1d4f4a67 100644 (file)
@@ -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
This page took 0.035768 seconds and 5 git commands to generate.