* miscfuncs.cc (__import_address): Cover the first dereference to imp

under the fault handler.
This commit is contained in:
Corinna Vinschen
2014-08-21 09:04:09 +00:00
parent b1f81c3b71
commit 33ed7bb5bc
2 changed files with 7 additions and 2 deletions

View File

@ -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));