Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-26 07:26:44 +0400
committerChristopher Faylor <me@cgf.cx>2003-09-26 07:26:44 +0400
commit912f81352ffc556ada543565f2a1a4b78d42dea4 (patch)
tree4aa8444c48ac02e6b3b851beaf9ce8609b12de7a /winsup/cygwin
parent6c68fbbc61b58863debe39c97f71a9d06ecc87f5 (diff)
* dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than a NULL
pointer or suffer SEGVs with invalid paths.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dtable.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f28edfa0e..0a2fff398 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2003-09-25 Christopher Faylor <cgf@redhat.com>
+ * dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than
+ a NULL pointer or suffer SEGVs with invalid paths.
+
+2003-09-25 Christopher Faylor <cgf@redhat.com>
+
* fork.cc (fork_parent): Detect failed pinfo constructor.
* spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo
constructor.
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 9ca5d6a86..e7b185104 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -287,6 +287,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
}
}
+#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
fhandler_base *
build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si)
{
@@ -294,7 +295,7 @@ build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si)
if (pc.error)
{
set_errno (pc.error);
- return NULL;
+ return cnew (fhandler_nodevice) ();
}
if (!pc.exists () && h)
@@ -325,7 +326,6 @@ build_fh_dev (const device& dev, const char *unix_name)
return build_fh_pc (pc);
}
-#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
fhandler_base *
build_fh_pc (path_conv& pc)
{