aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2010-01-25 18:44:17 +0000
committerSebastian Hahn <sebastian@torproject.org>2010-01-26 11:55:43 +0100
commit7e65871ccc49f6f25f8782789283cf2afef6e86b (patch)
treec306dda2137e8799a29fb6f2ddd018c30e4f3157 /src/or/geoip.c
parent2d3f21e9ee5d173640b83b21913da692e74ede10 (diff)
downloadtor-7e65871ccc49f6f25f8782789283cf2afef6e86b.tar
tor-7e65871ccc49f6f25f8782789283cf2afef6e86b.tar.gz
Fix a memory corruption bug while collecting bridge stats
We accidentally freed the internal buffer for bridge stats when we were writing the bridge stats file or honoring a control port request for said data. Change the interfaces for geoip_get_bridge_stats* to prevent these problems, and remove the offending free/add a tor_strdup. Fixes bug 1208.
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index a00280e39..7208b8986 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -1254,7 +1254,7 @@ load_bridge_stats(time_t now)
/** Return most recent bridge statistics for inclusion in extra-info
* descriptors, or NULL if we don't have recent bridge statistics. */
-char *
+const char *
geoip_get_bridge_stats_extrainfo(time_t now)
{
load_bridge_stats(now);
@@ -1263,7 +1263,7 @@ geoip_get_bridge_stats_extrainfo(time_t now)
/** Return most recent bridge statistics to be returned to controller
* clients, or NULL if we don't have recent bridge statistics. */
-char *
+const char *
geoip_get_bridge_stats_controller(time_t now)
{
load_bridge_stats(now);