diff options
author | Christopher Faylor <me@cgf.cx> | 2013-01-23 18:24:34 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-01-23 18:24:34 +0400 |
commit | a69e27906f250cfd96dfd431fd79b3749133128d (patch) | |
tree | b8588a244552722e17c94e245dae050fd5e7a0b0 /winsup | |
parent | 0e8c8b009361a87243874b8e576b9326d8ec9ab2 (diff) |
* miscfuncs.cc (__import_address): Check if malloc field points directly at
'malloc'.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/malloc_wrapper.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ef1fbab1f..873b94346 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + * miscfuncs.cc (__import_address): Check if malloc field points + directly at 'malloc'. + +2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + * miscfuncs.cc (__import_address): On second thought, the chance that this pointer could be NULL is very low so don't bother checking for it. diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc index c514af345..2adacba9c 100644 --- a/winsup/cygwin/malloc_wrapper.cc +++ b/winsup/cygwin/malloc_wrapper.cc @@ -286,7 +286,8 @@ malloc_init () extern void *_sigfe_malloc; /* Decide if we are using our own version of malloc by testing the import address from user_data. */ - use_internal = import_address (user_data->malloc) == &_sigfe_malloc; + use_internal = user_data->malloc == malloc + || import_address (user_data->malloc) == &_sigfe_malloc; malloc_printf ("using %s malloc", use_internal ? "internal" : "external"); internal_malloc_determined = true; } |