diff options
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 5 |
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; |