aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorJ. Ryan Stinnett <jryans@gmail.com>2016-12-04 22:26:52 -0600
committerJ. Ryan Stinnett <jryans@gmail.com>2016-12-06 11:11:43 -1000
commit9b2b799d82e00286145d42b9c59cb4f820e4f8c7 (patch)
treee85a73b242499c5e82de56a99af6c6e69728b8c1 /src/common/log.c
parent8a0ea3ee43da0063c2546092662fa7ce4900bc2c (diff)
downloadtor-9b2b799d82e00286145d42b9c59cb4f820e4f8c7.tar.gz
tor-9b2b799d82e00286145d42b9c59cb4f820e4f8c7.zip
Accept non-space whitespace characters in log severity syntax.
Adds a test_config_parse_log_severity unit test to verify behavior. Fixes #19965.
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 3b0eb882c3..1c592c6bda 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1319,10 +1319,8 @@ parse_log_severity_config(const char **cfg_ptr,
if (got_an_unqualified_range > 1)
return -1;
- space = strchr(cfg, ' ');
+ space = find_whitespace(cfg);
dash = strchr(cfg, '-');
- if (!space)
- space = strchr(cfg, '\0');
if (dash && dash < space) {
sev_lo = tor_strndup(cfg, dash-cfg);
sev_hi = tor_strndup(dash+1, space-(dash+1));