[newlib-cygwin] _pinfo::set_ctty: Check potential NULL pointer in debug_printf statement

Corinna Vinschen corinna@sourceware.org
Thu Nov 24 14:07:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=59ab07f170d32d09329eaa110c1a90ab534e399a

commit 59ab07f170d32d09329eaa110c1a90ab534e399a
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 24 15:06:51 2016 +0100

    _pinfo::set_ctty: Check potential NULL pointer in debug_printf statement
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 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 1ce6809..9b74442 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;
 }



More information about the Cygwin-cvs mailing list