From 59ab07f170d32d09329eaa110c1a90ab534e399a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 24 Nov 2016 15:06:51 +0100 Subject: [PATCH] _pinfo::set_ctty: Check potential NULL pointer in debug_printf statement Signed-off-by: Corinna Vinschen --- winsup/cygwin/pinfo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 1ce680943..9b74442d0 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -502,7 +502,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags) if (!tc.getpgid () && pgid == pid) tc.setpgid (pgid); } - debug_printf ("cygheap->ctty now %p, archetype %p", cygheap->ctty, fh->archetype); + debug_printf ("cygheap->ctty now %p, archetype %p", cygheap->ctty, fh ? fh->archetype : NULL); return ctty > 0; }