diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-11 16:17:27 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-20 23:35:19 +0000 |
commit | 90fa7296c22583a0a42203b078979bbfb2fcb11d (patch) | |
tree | a902300b0ceb46f19602b63a095a4ea1383c5cde | |
parent | 7fecbf6f2150394bea7a3435b22cea129d05c9a9 (diff) | |
download | openssl-90fa7296c22583a0a42203b078979bbfb2fcb11d.tar.gz |
Fix bug in async_fibre_makecontext for POSIX
async_fibre_makecontext was initialise the fibre first and then calling
getcontext(). It should be the other way around because the getcontext
call may overwrite some of the things we just initialised. This didn't
cause an issue on Linux and so the problem went unnoticed. On OS-X it
causes a crash.
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r-- | crypto/async/arch/async_posix.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/async/arch/async_posix.h b/crypto/async/arch/async_posix.h index aac12f1644..0f91464713 100644 --- a/crypto/async/arch/async_posix.h +++ b/crypto/async/arch/async_posix.h @@ -97,8 +97,8 @@ static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r) } # define async_fibre_makecontext(c) \ - (async_fibre_init(c) \ - && !getcontext(&(c)->fibre) \ + (!getcontext(&(c)->fibre) \ + && async_fibre_init(c) \ && (makecontext(&(c)->fibre, async_start_func, 0), 1)) # define async_fibre_init_dispatcher(d) |