paulirwin opened a new pull request, #1173:
URL: https://github.com/apache/lucenenet/pull/1173

   - [X] You've read the [Contributor 
Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code 
of Conduct](https://www.apache.org/foundation/policies/conduct.html).
   - [X] You've included unit or integration tests for your change, where 
applicable.
   - [X] You've included inline docs for your change, where applicable.
   - [X] There's an open issue for the PR that you are making. If you'd like to 
propose a change, please [open an 
issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the 
change or find an existing issue.
   
   Fix integer overflow in IndexInputStream.Read()
   
   Fixes #1158
   
   ## Description
   
   When input.Length - input.Position exceeds int.MaxValue, casting to int 
causes overflow resulting in negative values. This fix uses long for the 
remaining calculation before safely casting to int via Math.Min.
   
   Thanks to @ChaoMaWisetech for providing the proposed solution.
   


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