dxbjavid opened a new pull request, #323: URL: https://github.com/apache/commons-math/pull/323
Noticed that verifyValues checks `begin + length > values.length` with int arithmetic after only validating that begin and length are non-negative. With large begin/length the sum overflows to a negative int, the check passes, and the helper reports an out-of-range subarray as valid: `MathArrays.verifyValues(new double[10], 1, Integer.MAX_VALUE, false)` returns true instead of throwing. AbstractUnivariateStatistic.setData has the same check and then trips a raw ArrayIndexOutOfBoundsException in the arraycopy. Widening the sum to long closes the bypass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
