* miscfuncs.cc (__import_address): Avoid treating random instructions as import

jump.
* malloc_wrapper.cc (malloc_init): Remove comment about 64-bit.
This commit is contained in:
Christopher Faylor
2013-01-23 02:02:36 +00:00
parent 6c3f590cd9
commit 9c4478df47
3 changed files with 12 additions and 2 deletions

View File

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