summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 1f541d976f..e169a3f6cc 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -261,6 +261,9 @@ logv(int severity, log_domain_mask_t domain, const char *funcname,
/* Call assert, not tor_assert, since tor_assert calls log on failure. */
assert(format);
+ /* check that severity is sane. Overrunning the masks array leads to
+ * interesting and hard to diagnose effects */
+ assert(severity >= LOG_ERR && severity <= LOG_DEBUG);
LOCK_LOGS();
lf = logfiles;
while (lf) {