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:
authorChristopher Faylor <me@cgf.cx>2013-01-23 06:02:36 +0400
committerChristopher Faylor <me@cgf.cx>2013-01-23 06:02:36 +0400
commit9c4478df471a04c898098afcc417260ad39b138c (patch)
tree278e3d785d545fba91eeb054321ae1e89e347fe0 /winsup/cygwin
parent6c3f590cd99ec6f666ee75afa0dfd2c45fc680ca (diff)
* 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')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/malloc_wrapper.cc3
-rw-r--r--winsup/cygwin/miscfuncs.cc5
3 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 51e2467d0..3bd365f85 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-22 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * miscfuncs.cc (__import_address): Avoid treating random instructions
+ as import jump.
+ * malloc_wrapper.cc (malloc_init): Remove comment about 64-bit.
+
2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx>
* dcrt0.cc (dll_crt0_1): Comment assumption.
diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc
index 46493b775..c514af345 100644
--- a/winsup/cygwin/malloc_wrapper.cc
+++ b/winsup/cygwin/malloc_wrapper.cc
@@ -285,8 +285,7 @@ malloc_init ()
{
extern void *_sigfe_malloc;
/* Decide if we are using our own version of malloc by testing the import
- address from user_data. This will likely need to be updated
- for 64-bit. */
+ address from user_data. */
use_internal = import_address (user_data->malloc) == &_sigfe_malloc;
malloc_printf ("using %s malloc", use_internal ? "internal" : "external");
internal_malloc_determined = true;
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;