From 7e65871ccc49f6f25f8782789283cf2afef6e86b Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Mon, 25 Jan 2010 18:44:17 +0000 Subject: 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. --- src/or/control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/or/control.c') diff --git a/src/or/control.c b/src/or/control.c index be1e921f3..13a5f46b1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1755,10 +1755,10 @@ getinfo_helper_events(control_connection_t *control_conn, "information", question); } } else if (!strcmp(question, "status/clients-seen")) { - char *bridge_stats = geoip_get_bridge_stats_controller(time(NULL)); + const char *bridge_stats = geoip_get_bridge_stats_controller(time(NULL)); if (!bridge_stats) return -1; - *answer = bridge_stats; + *answer = tor_strdup(bridge_stats); } else { return 0; } -- cgit v1.2.3