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:
authorCorinna Vinschen <corinna@vinschen.de>2014-08-21 13:04:09 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-08-21 13:04:09 +0400
commit33ed7bb5bc2cb41259df064229968933d9c898ca (patch)
treef9d5e776849c0b297ee7ef984d10027935ecfbfb
parentb1f81c3b7117aae42dbd6f8fd38ad45643b9bfee (diff)
* miscfuncs.cc (__import_address): Cover the first dereference to imp
under the fault handler.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/miscfuncs.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index fe21ee26c..51ebe5489 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2014-08-21 Corinna Vinschen <corinna@vinschen.de>
+ * miscfuncs.cc (__import_address): Cover the first dereference to imp
+ under the fault handler.
+
+2014-08-21 Corinna Vinschen <corinna@vinschen.de>
+
* net.cc (if_freenameindex): Don't catch a SEGV from free to fail
loudly on double free.
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 1ec92d9dc..741e6726b 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -512,11 +512,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;
+ if (*((uint16_t *) imp) != 0x25ff)
+ return NULL;
const char *ptr = (const char *) imp;
#ifdef __x86_64__
const uintptr_t *jmpto = (uintptr_t *) (ptr + 6 + *(int32_t *)(ptr + 2));