diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-18 14:34:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-18 14:34:49 -0400 |
commit | 620108ea7770608de72dcbea4ca73d6fb99c1109 (patch) | |
tree | 20d47f2ad1259938774c9c3f0e3d615d18205a2a /src/feature/nodelist | |
parent | ea5792f333b1b92306d20e60b5e12bb0633aa740 (diff) | |
download | tor-620108ea7770608de72dcbea4ca73d6fb99c1109.tar.gz tor-620108ea7770608de72dcbea4ca73d6fb99c1109.zip |
Assert that we aren't returning a pointer to a local variable.
GCC got confused here with LTO enabled.
Fixes part of #27772.
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r-- | src/feature/nodelist/routerparse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/feature/nodelist/routerparse.c b/src/feature/nodelist/routerparse.c index b76b2974fa..ae57fbe499 100644 --- a/src/feature/nodelist/routerparse.c +++ b/src/feature/nodelist/routerparse.c @@ -4436,7 +4436,9 @@ router_parse_addr_policy(directory_token_t *tok, unsigned fmt_flags) return NULL; } - return addr_policy_get_canonical_entry(&newe); + addr_policy_t *result = addr_policy_get_canonical_entry(&newe); + tor_assert(result != &newe); // We aren't returning the one from the stack. + return result; } /** Parse an exit policy line of the format "accept[6]/reject[6] private:...". |