diff options
author | erdgeist <> | 2009-08-30 12:54:52 +0000 |
---|---|---|
committer | erdgeist <> | 2009-08-30 12:54:52 +0000 |
commit | 517adde681d6aec49f359c4e7925641b1c86a075 (patch) | |
tree | e7556ca1b1ba567a5a49cab84c361069f55cadb5 | |
parent | 342182a496976d433e02b9cdd53719b9abad4cb7 (diff) |
Limit shifting in s24s cleanup code to a non-overflowing size
-rw-r--r-- | ot_stats.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: | |||
276 | bailout_error: | 276 | bailout_error: |
277 | r = reply; | 277 | r = reply; |
278 | success: | 278 | success: |
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; |