tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit c29f05b159ae51472cd2a183a36cb9d352c082e5
parent cdd7e889703fbc089780f446715b7b41ccbf688e
Author: George Kadianakis <desnacked@riseup.net>
Date:   Thu,  5 Sep 2019 17:06:58 +0300

Merge branch 'tor-github/pr/1292'

Diffstat:
Achanges/ticket31529 | 5+++++
Msrc/app/config/confparse.c | 11++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/changes/ticket31529 b/changes/ticket31529 @@ -0,0 +1,5 @@ + o Minor features (debugging): + - Log a nonfatal assertion failure if we encounter a configuration + line whose command is "CLEAR" but which has a nonempty value. + This should be impossible, according to the rules of our + configuration line parsing. Closes ticket 31529. diff --git a/src/app/config/confparse.c b/src/app/config/confparse.c @@ -652,9 +652,14 @@ config_assign_line(const config_mgr_t *mgr, void *options, } return 0; } else if (c->command == CONFIG_LINE_CLEAR && !clear_first) { - // XXXX This is unreachable, since a CLEAR line always has an - // XXXX empty value. - config_reset(mgr, options, mvar, use_defaults); // LCOV_EXCL_LINE + // This block is unreachable, since a CLEAR line always has an + // empty value, and so will trigger be handled by the previous + // "if (!strlen(c->value))" block. + + // LCOV_EXCL_START + tor_assert_nonfatal_unreached(); + config_reset(mgr, options, mvar, use_defaults); + // LCOV_EXCL_STOP } if (options_seen && ! config_var_is_cumulative(cvar)) {