summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-01-23 02:02:36 +0000
committerChristopher Faylor <me@cgf.cx>2013-01-23 02:02:36 +0000
commit9c4478df471a04c898098afcc417260ad39b138c (patch)
tree278e3d785d545fba91eeb054321ae1e89e347fe0 /winsup/cygwin/miscfuncs.cc
parent6c3f590cd99ec6f666ee75afa0dfd2c45fc680ca (diff)
downloadcygnal-9c4478df471a04c898098afcc417260ad39b138c.tar.gz
cygnal-9c4478df471a04c898098afcc417260ad39b138c.tar.bz2
cygnal-9c4478df471a04c898098afcc417260ad39b138c.zip
* miscfuncs.cc (__import_address): Avoid treating random instructions as import
jump. * malloc_wrapper.cc (malloc_init): Remove comment about 64-bit.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 8033ac7a4..4f9c9df9d 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -437,6 +437,11 @@ slashify (const char *src, char *dst, bool trailing_slash_p)
void * __reg1
__import_address (void *imp)
{
+ if (*((uint16_t *) imp) != 0x25ff)
+ return NULL;
+ myfault efault;
+ if (efault.faulted ())
+ return NULL;
const char *ptr = (const char *) imp;
const uintptr_t *jmpto = (uintptr_t *) *((uintptr_t *) (ptr + 2));
return (void *) *jmpto;