Reapply 3b1e94ec5d correctly

This time without accidentally-included files...

If compiling without backtrace or BFD support, we initialise the
location to store return addresses incorrectly, leaving a dangling
pointer which we then right over.

Most consumers never read this, so it seemed to work most of the time by
just overwriting a random bit of memory.

This probably has security implications, because throwing an exception
can clobber random bits of memory, though not with attacker-controlled
data.
This commit is contained in:
David Chisnall 2018-04-07 20:04:14 +01:00
parent 970c8cbd05
commit 7bf1179f60

View file

@ -966,7 +966,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
{
jbuf_type *env;
returns = malloc(numReturns * sizeof(void*));
*returns = malloc(numReturns * sizeof(void*));
env = jbuf();
if (sigsetjmp(env->buf, 1) == 0)