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.
This commit is contained in:
@@ -739,9 +739,7 @@ verifyable_object::~verifyable_object ()
|
||||
int __stdcall
|
||||
check_valid_pointer (void *pointer)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION m;
|
||||
if (!pointer || !VirtualQuery (pointer, &m, sizeof (m))
|
||||
|| (m.State != MEM_COMMIT))
|
||||
if (!pointer || IsBadWritePtr (pointer, sizeof (verifyable_object)))
|
||||
return EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user