Browse Source

Limit shifting in s24s cleanup code to a non-overflowing size

master
Dirk Engling 12 years ago
parent
commit
ff4e4d848c
  1. 6
      ot_stats.c

6
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; i<STATS_NETWORK_NODE_COUNT; ++i )
rest += ((*node)->counters[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;
@ -706,4 +706,4 @@ void stats_deinit( ) {
pthread_cancel( thread_id );
}
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.53 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.54 $\n";
Loading…
Cancel
Save