dxbjavid opened a new pull request, #331:
URL: https://github.com/apache/commons-math/pull/331

   SparseFieldMatrix computes its hash key as row * columns + column in int 
arithmetic, but unlike OpenMapRealMatrix its constructor never checks that the 
dimension product fits in an int, so a sparse matrix such as 100000 by 100000 
is accepted and the key wraps for cells beyond the first 2^31. Two distinct 
cells can then share a key, for example setEntry(42950, 0) silently overwrites 
the value stored at (0, 32704), which seems worse than a failure since nothing 
signals the corruption. This adds the same NumberIsTooLargeException guard that 
MATH-679 gave OpenMapRealMatrix, along with a test that fails on master. AI 
tooling was used to help prepare this change.
   


-- 
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]

Reply via email to