diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-01-20 15:00:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-01-20 15:00:42 -0500 |
commit | c496229b0a8d90a327674a03aa5be455014b4d5c (patch) | |
tree | 5a01a8f07bc73b46c3af014242278fc7048d4725 | |
parent | f6a25a995ea120b4415058131a01bc69542280e9 (diff) | |
parent | 13e9a2b19d4a65d9761256ac72f754c35c371b0b (diff) | |
download | tor-c496229b0a8d90a327674a03aa5be455014b4d5c.tar.gz tor-c496229b0a8d90a327674a03aa5be455014b4d5c.zip |
Merge remote branch 'origin/maint-0.2.2'
-rw-r--r-- | changes/policy_summarize-assert | 6 | ||||
-rw-r--r-- | src/or/policies.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/changes/policy_summarize-assert b/changes/policy_summarize-assert new file mode 100644 index 0000000000..619e8e7e42 --- /dev/null +++ b/changes/policy_summarize-assert @@ -0,0 +1,6 @@ + o Major bugfixes (security) + - Fix a bounds-checking error that could allow an attacker to + remotely crash a directory authority. Found by piebeer. + Bugfix on 0.2.1.5-alpha. + + diff --git a/src/or/policies.c b/src/or/policies.c index e5af7887c7..d0406d3889 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -1256,8 +1256,8 @@ policy_summarize(smartlist_t *policy) accepts_str = smartlist_join_strings(accepts, ",", 0, &accepts_len); rejects_str = smartlist_join_strings(rejects, ",", 0, &rejects_len); - if (rejects_len > MAX_EXITPOLICY_SUMMARY_LEN && - accepts_len > MAX_EXITPOLICY_SUMMARY_LEN) { + if (rejects_len > MAX_EXITPOLICY_SUMMARY_LEN-strlen("reject")-1 && + accepts_len > MAX_EXITPOLICY_SUMMARY_LEN-strlen("accept")-1) { char *c; shorter_str = accepts_str; prefix = "accept"; |