From 7a4078ee340b7f15c839257d6fa895d92abe0224 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 28 Jun 2001 02:19:57 +0000 Subject: Change check_null_empty_path* to check_null_empty_str* throughout. * path.cc (path_conv::check): Add signal protection here since retrieving info about remote shares can take some time. * path.h (check_null_empty_str_errno): Convert to a function prototype. * path.cc (check_null_empty_str): Move to miscfuncs.cc. * miscfuncs.cc (check_null_empty_str_errno): New function. (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (check_null_empty_str): Change from VirtualQuery to IsBadWritePtr. * thread.cc (check_valid_pointer): Ditto. * resource.cc (getrlimit): Use check_null_invalid_struct macro for checking validity of pointer. (setrlimit): Ditto. --- winsup/cygwin/winsup.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'winsup/cygwin/winsup.h') diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index b725f8243..8beac76e6 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -190,6 +190,16 @@ long __stdcall to_time_t (FILETIME * ptr); void __stdcall set_console_title (char *); void set_console_handler (); +int __stdcall check_null_empty_str (const char *name) __attribute__ ((regparm(1))); +int __stdcall check_null_empty_str_errno (const char *name) __attribute__ ((regparm(1))); +int __stdcall __check_null_invalid_struct (const void *s, unsigned sz) __attribute__ ((regparm(1))); +int __stdcall __check_null_invalid_struct_errno (const void *s, unsigned sz) __attribute__ ((regparm(1))); + +#define check_null_invalid_struct(s) \ + __check_null_invalid ((s), sizeof (*(s))) +#define check_null_invalid_struct_errno(s) \ + __check_null_invalid_struct_errno ((s), sizeof (*(s))) + #define set_winsock_errno() __set_winsock_errno (__FUNCTION__, __LINE__) void __set_winsock_errno (const char *fn, int ln) __attribute__ ((regparm(2))); -- cgit v1.2.3