diff options
author | cypherpunks <cypherpunks@torproject.org> | 2015-12-15 16:30:04 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-15 11:52:00 -0500 |
commit | 07cca627eaab800d4874f3d0914d3cf7eaa601a9 (patch) | |
tree | 6fec11ee49f2c8fb086e3d60be3291b73fe790f9 /src/common/backtrace.h | |
parent | 254d63dabe0b89f83c4df0edb1daf719cc5d4ab7 (diff) | |
download | tor-07cca627eaab800d4874f3d0914d3cf7eaa601a9.tar.gz tor-07cca627eaab800d4874f3d0914d3cf7eaa601a9.zip |
Fix backtrace compilation on FreeBSD
On FreeBSD backtrace(3) uses size_t instead of int (as glibc does). This
causes integer precision loss errors when we used int to store its
results.
The issue is fixed by using size_t to store the results of backtrace(3).
The manual page of glibc does not mention that backtrace(3) returns
negative values. Therefore, no unsigned integer wrapping occurs when its
result is stored in an unsigned data type.
Diffstat (limited to 'src/common/backtrace.h')
-rw-r--r-- | src/common/backtrace.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/backtrace.h b/src/common/backtrace.h index a9151d7956..838e18eedd 100644 --- a/src/common/backtrace.h +++ b/src/common/backtrace.h @@ -13,7 +13,7 @@ void clean_up_backtrace_handler(void); #ifdef EXPOSE_CLEAN_BACKTRACE #if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \ defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION) -void clean_backtrace(void **stack, int depth, const ucontext_t *ctx); +void clean_backtrace(void **stack, size_t depth, const ucontext_t *ctx); #endif #endif |