diff options
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/fhandler/pty.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc index e9d9b351d..df37d9189 100644 --- a/winsup/cygwin/fhandler/pty.cc +++ b/winsup/cygwin/fhandler/pty.cc @@ -3886,7 +3886,9 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp, to = ttyp->to_slave (); pinfo p (ttyp->master_pid); - HANDLE pty_owner = OpenProcess (PROCESS_DUP_HANDLE, FALSE, p->dwProcessId); + HANDLE pty_owner = NULL; + if (p) + pty_owner = OpenProcess (PROCESS_DUP_HANDLE, FALSE, p->dwProcessId); if (pty_owner) { DuplicateHandle (pty_owner, to, GetCurrentProcess (), &to, |