[or-cvs] [tor/release-0.2.2 012/162] Fix a bridge segfault

arma at torproject.org arma at torproject.org
Mon Dec 20 03:06:28 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Mon, 27 Sep 2010 23:15:43 +0200
Subject: Fix a bridge segfault
Commit: c951830002706719fd98f87dabd82437f3f392ac

When we enabled support to change statistic options without restarting
Tor we forgot to initialize geoip_countries. Fix that.
---
 changes/bug1964 |    3 +++
 src/or/geoip.c  |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 changes/bug1964

diff --git a/changes/bug1964 b/changes/bug1964
new file mode 100644
index 0000000..d100094
--- /dev/null
+++ b/changes/bug1964
@@ -0,0 +1,3 @@
+  o Major bugfixes:
+    - Fix a segfault that can happen when using bridges. Fixes bug 1964;
+      bugfix on 0.2.2.15-alpha.
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 7f1052e..ee8d72e 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -254,6 +254,8 @@ geoip_get_country_by_ip(uint32_t ipaddr)
 int
 geoip_get_n_countries(void)
 {
+  if (!geoip_countries)
+    init_geoip_countries();
   return (int) smartlist_len(geoip_countries);
 }
 
-- 
1.7.1




More information about the tor-commits mailing list