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:
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 26c29c3f2..3c8f16e03 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -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;
}