From 517adde681d6aec49f359c4e7925641b1c86a075 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sun, 30 Aug 2009 12:54:52 +0000 Subject: Limit shifting in s24s cleanup code to a non-overflowing size --- ot_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ot_stats.c b/ot_stats.c index 46fc961..3d01e10 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -111,7 +111,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth, depth += STATS_NETWORK_NODE_BITWIDTH; if( depth == STATS_NETWORK_NODE_MAXDEPTH ) { for( i=0; icounters[i]>>=shift); + rest += (*node)->counters[i] >>= shift; return rest; } @@ -276,7 +276,7 @@ bailout_unlock: bailout_error: r = reply; success: - stats_shift_down_network_count( &slash24s_network_counters_root, 0, STATS_NETWORK_NODE_MAXDEPTH*STATS_NETWORK_NODE_BITWIDTH ); + stats_shift_down_network_count( &slash24s_network_counters_root, 0, sizeof(int)*8-1 ); if( slash24s_network_counters_root ) free( slash24s_network_counters_root ); return r-reply; -- cgit v1.2.3