mirror of
git://erdgeist.org/opentracker
synced 2025-02-05 11:36:24 +00:00
Limit shifting in s24s cleanup code to a non-overflowing size
This commit is contained in:
parent
342182a496
commit
517adde681
@ -111,7 +111,7 @@ static int stats_shift_down_network_count( stats_network_node **node, int depth,
|
|||||||
depth += STATS_NETWORK_NODE_BITWIDTH;
|
depth += STATS_NETWORK_NODE_BITWIDTH;
|
||||||
if( depth == STATS_NETWORK_NODE_MAXDEPTH ) {
|
if( depth == STATS_NETWORK_NODE_MAXDEPTH ) {
|
||||||
for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i )
|
for( i=0; i<STATS_NETWORK_NODE_COUNT; ++i )
|
||||||
rest += ((*node)->counters[i]>>=shift);
|
rest += (*node)->counters[i] >>= shift;
|
||||||
return rest;
|
return rest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ bailout_unlock:
|
|||||||
bailout_error:
|
bailout_error:
|
||||||
r = reply;
|
r = reply;
|
||||||
success:
|
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 )
|
if( slash24s_network_counters_root )
|
||||||
free( slash24s_network_counters_root );
|
free( slash24s_network_counters_root );
|
||||||
return r-reply;
|
return r-reply;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user