diff options
author | teor <teor@torproject.org> | 2019-10-20 20:01:56 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-20 20:01:56 +1000 |
commit | 0a5ce8280c7b7e4121237db5a29ea9e0084ffb05 (patch) | |
tree | 08655811aefe699dc067c666d7b0fff72870c2a8 /src/lib/err | |
parent | f0f3f3338e220f773b4921215f3c9955f5601a7c (diff) | |
download | tor-0a5ce8280c7b7e4121237db5a29ea9e0084ffb05.tar.gz tor-0a5ce8280c7b7e4121237db5a29ea9e0084ffb05.zip |
err: Use the correct type for cb_buf
Fixes bug 32060; bug not in any released version of tor.
Resolves CID 1454761.
Diffstat (limited to 'src/lib/err')
-rw-r--r-- | src/lib/err/backtrace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/err/backtrace.c b/src/lib/err/backtrace.c index bc3ca286ec..ce8ddcd7c0 100644 --- a/src/lib/err/backtrace.c +++ b/src/lib/err/backtrace.c @@ -85,7 +85,7 @@ static pthread_mutex_t cb_buf_mutex = PTHREAD_MUTEX_INITIALIZER; /** Lock and return a static stack pointer buffer that can hold up to * MAX_DEPTH function pointers. */ -static void * +static void ** lock_cb_buf(void) { /* Lock the mutex first, before even declaring the buffer. */ @@ -102,7 +102,7 @@ lock_cb_buf(void) /** Unlock the static stack pointer buffer. */ static void -unlock_cb_buf(void *cb_buf) +unlock_cb_buf(void **cb_buf) { memset(cb_buf, 0, SIZEOF_CB_BUF); pthread_mutex_unlock(&cb_buf_mutex); @@ -149,7 +149,7 @@ log_backtrace_impl(int severity, log_domain_mask_t domain, const char *msg, char **symbols; size_t i; - void *cb_buf = lock_cb_buf(); + void **cb_buf = lock_cb_buf(); depth = backtrace(cb_buf, MAX_DEPTH); symbols = backtrace_symbols(cb_buf, (int)depth); @@ -183,7 +183,7 @@ crash_handler(int sig, siginfo_t *si, void *ctx_) int n_fds, i; const int *fds = NULL; - void *cb_buf = lock_cb_buf(); + void **cb_buf = lock_cb_buf(); (void) si; @@ -214,7 +214,7 @@ dump_stack_symbols_to_error_fds(void) const int *fds = NULL; size_t depth; - void *cb_buf = lock_cb_buf(); + void **cb_buf = lock_cb_buf(); depth = backtrace(cb_buf, MAX_DEPTH); @@ -256,7 +256,7 @@ install_bt_handler(void) * libc has pre-loaded the symbols we need to dump things, so that later * reads won't be denied by the sandbox code */ char **symbols; - void *cb_buf = lock_cb_buf(); + void **cb_buf = lock_cb_buf(); size_t depth = backtrace(cb_buf, MAX_DEPTH); symbols = backtrace_symbols(cb_buf, (int) depth); if (symbols) |