summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2009-08-30 12:54:52 +0000
committererdgeist <>2009-08-30 12:54:52 +0000
commit517adde681d6aec49f359c4e7925641b1c86a075 (patch)
treee7556ca1b1ba567a5a49cab84c361069f55cadb5
parent342182a496976d433e02b9cdd53719b9abad4cb7 (diff)
Limit shifting in s24s cleanup code to a non-overflowing size
-rw-r--r--ot_stats.c4
1 files 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,
111 depth += STATS_NETWORK_NODE_BITWIDTH; 111 depth += STATS_NETWORK_NODE_BITWIDTH;
112 if( depth == STATS_NETWORK_NODE_MAXDEPTH ) { 112 if( depth == STATS_NETWORK_NODE_MAXDEPTH ) {
113 for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i ) 113 for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i )
114 rest += ((*node)->counters[i]>>=shift); 114 rest += (*node)->counters[i] >>= shift;
115 return rest; 115 return rest;
116 } 116 }
117 117
@@ -276,7 +276,7 @@ bailout_unlock:
276bailout_error: 276bailout_error:
277 r = reply; 277 r = reply;
278success: 278success:
279 stats_shift_down_network_count( &slash24s_network_counters_root, 0, STATS_NETWORK_NODE_MAXDEPTH*STATS_NETWORK_NODE_BITWIDTH ); 279 stats_shift_down_network_count( &slash24s_network_counters_root, 0, sizeof(int)*8-1 );
280 if( slash24s_network_counters_root ) 280 if( slash24s_network_counters_root )
281 free( slash24s_network_counters_root ); 281 free( slash24s_network_counters_root );
282 return r-reply; 282 return r-reply;