Description
In the file lib/service/instrumentation/InstrumentationService.java, the method
Timer.getValues has the following code:
long[] getValues() { ...... int limit = (full) ? size : (last + 1); ...... values[AVG_TOTAL] = values[AVG_TOTAL] / limit; }
The variable limit is used as a divisor. However, its value may be equal to last + 1, which can be zero since last is initialized to -1 in the constructor:
public Timer(int size) { ... last = -1; }
Thus, a divide by zero problem can happen.