From b364b3986758d395ab97117a9543dc816fc34bd2 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 9 Mar 2005 20:56:44 +0000 Subject: [PATCH] * net.cc (dup_ent): Avoid dereferencing a null pointer in a debug_printf. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/net.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9c2f7bcae..112e84c7d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2005-03-09 Christopher Faylor + + * net.cc (dup_ent): Avoid dereferencing a null pointer in a debug_printf. + 2005-03-09 Christopher Faylor * path.cc (path_conv::check): Treat ENOSHARE similarly to ENOENT when diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 3fee9eb91..ed52807d6 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -389,7 +389,7 @@ dup_ent (void *old, void *src0, struct_type type) if (old) { debug_printf ("freeing old %sent structure \"%s\" %p\n", entnames[type], - ((unionent *) old)->name, old); + old ? ((unionent *) old)->name : "", old); free (old); }