summaryrefslogtreecommitdiff
path: root/src/common/sandbox.c
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-12-15 16:30:04 +0100
committerNick Mathewson <nickm@torproject.org>2015-12-15 11:52:00 -0500
commit07cca627eaab800d4874f3d0914d3cf7eaa601a9 (patch)
tree6fec11ee49f2c8fb086e3d60be3291b73fe790f9 /src/common/sandbox.c
parent254d63dabe0b89f83c4df0edb1daf719cc5d4ab7 (diff)
downloadtor-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/sandbox.c')
-rw-r--r--src/common/sandbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index b995762738..3a9f2a1898 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -1598,7 +1598,7 @@ sigsys_debugging(int nr, siginfo_t *info, void *void_context)
const char *syscall_name;
int syscall;
#ifdef USE_BACKTRACE
- int depth;
+ size_t depth;
int n_fds, i;
const int *fds = NULL;
#endif