diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2011-01-20 11:17:57 -0800 |
---|---|---|
committer | Robert Ransom <rransom.8774@gmail.com> | 2011-01-20 11:17:57 -0800 |
commit | 43414eb98821d3b5c6c65181d7545ce938f82c8e (patch) | |
tree | 7fdb23b456bc29c27955e55b20d3f2855e8913a0 /src | |
parent | 511049025350339629f270cde9495963e48d10d2 (diff) | |
download | tor-43414eb98821d3b5c6c65181d7545ce938f82c8e.tar.gz tor-43414eb98821d3b5c6c65181d7545ce938f82c8e.zip |
Fix bounds-checking in policy_summarize
Found by piebeer.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/policies.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index d4b4a07c56..0a8fd7328e 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -1209,8 +1209,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"; |