aboutsummaryrefslogtreecommitdiff
path: root/src/lib/log
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-08-19 13:59:57 -0400
committerNick Mathewson <nickm@torproject.org>2019-08-19 13:59:57 -0400
commit87a3c5b1109a65fdf9b436f1035126044d77e552 (patch)
tree59120358b445ed1615c1c4da94f501787fffdb05 /src/lib/log
parent36a27fa2d331c53802635431849ca9a400122a4e (diff)
downloadtor-87a3c5b1109a65fdf9b436f1035126044d77e552.tar.gz
tor-87a3c5b1109a65fdf9b436f1035126044d77e552.zip
Fix 64-bit return issue in parse_log_domain()
If unsigned int is 32-bits long, then our old code would give a wrong result with any log domain whose mask was >= (1<<32). Fortunately, there are no such log domains right now: the domain mask is only 64 bits long to accommodate some flags. Found by coverity as CID 1452041. Fixes bug 31451; bugfix on 0.4.1.4-rc.
Diffstat (limited to 'src/lib/log')
-rw-r--r--src/lib/log/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/log/log.c b/src/lib/log/log.c
index d95bf1ff6e..56f016eae4 100644
--- a/src/lib/log/log.c
+++ b/src/lib/log/log.c
@@ -1285,7 +1285,7 @@ parse_log_domain(const char *domain)
int i;
for (i=0; domain_list[i]; ++i) {
if (!strcasecmp(domain, domain_list[i]))
- return (1u<<i);
+ return (UINT64_C(1)<<i);
}
return 0;
}