[or-cvs] [tor/maint-0.2.1] Avoid a memory corruption problem related to "private" in DirPolicy.

Nick Mathewson nickm at seul.org
Sat Jun 6 21:34:13 UTC 2009


Author: Nick Mathewson <nickm at torproject.org>
Date: Fri, 5 Jun 2009 19:41:40 -0400
Subject: Avoid a memory corruption problem related to "private" in DirPolicy.
Commit: 20193fc7ab16f735f35a16368bfd83e2e565456e

This is a posible fix for bug 996.
---
 ChangeLog         |    3 +++
 src/or/policies.c |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b2ba413..29d1c0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -88,6 +88,9 @@ Changes in version 0.2.1.14-rc - 2009-04-12
       patch by Sebastian.
     - Avoid crashing in the presence of certain malformed descriptors.
       Found by lark, and by automated fuzzing.
+    - Avoid crashing when we have "private" in a policy specified in
+      a DirPolicy or SocksPolicy or ReachableAddresses option and we
+      re-load the policy.  May fix bug 996.
 
   o Minor features:
     - When generating circuit events with verbose nicknames for
diff --git a/src/or/policies.c b/src/or/policies.c
index cb914d1..d55e86c 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -411,6 +411,7 @@ load_policy_from_option(config_line_t *config, smartlist_t **policy,
         memcpy(&newp, n, sizeof(newp));
         newp.prt_min = 1;
         newp.prt_max = 65535;
+        newp.is_canonical = 0;
         c = addr_policy_get_canonical_entry(&newp);
         SMARTLIST_REPLACE_CURRENT(*policy, n, c);
         addr_policy_free(n);
-- 
1.5.6.5



More information about the tor-commits mailing list