* miscfunc.cc (__check_invalid_read_ptr): New function.

* winsup.h: Declare.
This commit is contained in:
Corinna Vinschen 2003-10-27 08:28:37 +00:00
parent db30fe125f
commit d845665e0f
3 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-10-27 Corinna Vinschen <corinna@vinschen.de>
* miscfunc.cc (__check_invalid_read_ptr): New function.
* winsup.h: Declare.
2003-10-26 Corinna Vinschen <corinna@vinschen.de>
* security.h (cygpsid::debug_print): Avoid compiler warnings.

View File

@ -198,6 +198,14 @@ __check_null_invalid_struct_errno (void *s, unsigned sz)
return err;
}
int __stdcall
__check_invalid_read_ptr (const void *s, unsigned sz)
{
if (s && !IsBadReadPtr (s, sz))
return 0;
return EFAULT;
}
int __stdcall
__check_invalid_read_ptr_errno (const void *s, unsigned sz)
{

View File

@ -250,6 +250,7 @@ int __stdcall check_null_empty_str_errno (const char *name) __attribute__ ((regp
int __stdcall check_null_str_errno (const char *name) __attribute__ ((regparm(1)));
int __stdcall __check_null_invalid_struct (void *s, unsigned sz) __attribute__ ((regparm(2)));
int __stdcall __check_null_invalid_struct_errno (void *s, unsigned sz) __attribute__ ((regparm(2)));
int __stdcall __check_invalid_read_ptr (const void *s, unsigned sz) __attribute__ ((regparm(2)));
int __stdcall __check_invalid_read_ptr_errno (const void *s, unsigned sz) __attribute__ ((regparm(2)));
#define check_null_invalid_struct(s) \