summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-05 10:59:44 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-05 10:59:44 -0500
commit377584abbd56ab6d585ccde893398068ada8fdaa (patch)
tree3ce7dc41af25bbd3b527734209a8db9e1e889389 /src/common
parent5a0c94f0a9a1975cf2226c312dc29f25c4a0e210 (diff)
parentb330bdec8e628d34641a5e6942fa4d1a5357639a (diff)
downloadtor-377584abbd56ab6d585ccde893398068ada8fdaa.tar.gz
tor-377584abbd56ab6d585ccde893398068ada8fdaa.zip
Merge remote-tracking branch 'yawning/bug14740'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 2e7c711413..b533814844 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1215,7 +1215,8 @@ log_level_to_string(int level)
static const char *domain_list[] = {
"GENERAL", "CRYPTO", "NET", "CONFIG", "FS", "PROTOCOL", "MM",
"HTTP", "APP", "CONTROL", "CIRC", "REND", "BUG", "DIR", "DIRSERV",
- "OR", "EDGE", "ACCT", "HIST", "HANDSHAKE", "HEARTBEAT", "CHANNEL", NULL
+ "OR", "EDGE", "ACCT", "HIST", "HANDSHAKE", "HEARTBEAT", "CHANNEL",
+ "SCHED", NULL
};
/** Return a bitmask for the log domain for which <b>domain</b> is the name,
@@ -1245,7 +1246,8 @@ domain_to_string(log_domain_mask_t domain, char *buf, size_t buflen)
const char *d;
int bit = tor_log2(domain);
size_t n;
- if (bit >= N_LOGGING_DOMAINS) {
+ if ((unsigned)bit >= sizeof(domain_list)/sizeof(*domain_list) - 1 ||
+ bit >= N_LOGGING_DOMAINS) {
tor_snprintf(buf, buflen, "<BUG:Unknown domain %lx>", (long)domain);
return buf+strlen(buf);
}