diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-14 15:31:52 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-14 15:31:52 -0400 |
commit | 2dccef0eb490fa7d8fabc0d93e37d6635910f174 (patch) | |
tree | 65138098218cb4b11ffcbd3f6ac90501c45e2e99 /src/feature/dirparse | |
parent | 2c5c17510acf0cbd0eeb874a2f4c62203bf9392f (diff) | |
parent | 6925b61cfdf50a5686de02645b04b269c031f05d (diff) | |
download | tor-2dccef0eb490fa7d8fabc0d93e37d6635910f174.tar.gz tor-2dccef0eb490fa7d8fabc0d93e37d6635910f174.zip |
Merge branch 'bug27772_squashed'
Diffstat (limited to 'src/feature/dirparse')
-rw-r--r-- | src/feature/dirparse/policy_parse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/feature/dirparse/policy_parse.c b/src/feature/dirparse/policy_parse.c index e102a62282..f9102dd873 100644 --- a/src/feature/dirparse/policy_parse.c +++ b/src/feature/dirparse/policy_parse.c @@ -168,7 +168,14 @@ 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); + /* It would be a nasty error to return 'newe', and sometimes + * addr_policy_get_canonical_entry() can return its argument. But in this + * case, it won't, since newe is *not* canonical. We assert here to make + * sure that the compiler knows it too. + */ + tor_assert(result != &newe); + return result; } /** Parse an exit policy line of the format "accept[6]/reject[6] private:...". @@ -215,4 +222,3 @@ router_parse_addr_policy_private(directory_token_t *tok) return addr_policy_get_canonical_entry(&result); } - |