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>2001-11-24 06:11:39 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-24 06:11:39 +0300
commit5a64d8694176dbe7bd0c61c33d6e6cecd54d7a71 (patch)
treeed983f64a85995a97696cc7a132741e37f7498e7 /winsup/cygwin/miscfuncs.cc
parent97a2e0756d28fc4d0cf62ce5778b7d73160f77e5 (diff)
* dtable.cc (dtable::vfork_parent_restore): Add debugging statement.
* exceptions.cc (try_to_debug): Spin only as long as we don't have a debugger attached. * fhandler.h (fhandler_base::set_nohandle): New method. (fhandler_base::get_nohandle): New method. * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there is no handle. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle flag on dummy fd. * Makefile.in: Make intermediate library for eventual inclusion in libcygwin.a * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument setting since it is no longer used. * miscfuncs.cc (check_null_str): New function. (+check_null_str_errno): Ditto. * net.cc: Add defensive buffer checking throughout. (cygwin_sendto): Protect against invalid fd. (cygwin_recvfrom): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * winsup.h: Declare a new function. * select.cc (set_bits): Fix conditional for setting fd in exceptfds. * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using correct device type. * path.cc (get_devn): Set correct pipe device type from device name.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 4d72339cb..6cc03a669 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -116,6 +116,15 @@ strcasestr (const char *searchee, const char *lookfor)
}
int __stdcall
+check_null_str (const char *name)
+{
+ if (name && !IsBadStringPtr (name, MAX_PATH))
+ return 0;
+
+ return EFAULT;
+}
+
+int __stdcall
check_null_empty_str (const char *name)
{
if (name && !IsBadStringPtr (name, MAX_PATH))
@@ -134,6 +143,15 @@ check_null_empty_str_errno (const char *name)
}
int __stdcall
+check_null_str_errno (const char *name)
+{
+ int __err;
+ if ((__err = check_null_str (name)))
+ set_errno (__err);
+ return __err;
+}
+
+int __stdcall
__check_null_invalid_struct (const void *s, unsigned sz)
{
if (s && !IsBadWritePtr ((void *) s, sz))