jmestwa-coder opened a new pull request, #622:
URL: https://github.com/apache/logging-log4cxx/pull/622

   ## Description
   
   This change fixes a case where `ByteBuffer` could end up in an invalid state 
(`limit < position`). In that situation, `remaining()` may underflow and 
produce an incorrect large value, which can then propagate into stream 
read/write operations.
   
   ### Changes
   
   - Clamp `position` in `ByteBuffer::limit()` to maintain `position <= limit`
   - Update `InputStreamReader` carry handling to preserve remaining bytes 
using `memmove`, followed by `clear()` and `position(carry)`
   - Add a guard to prevent infinite loops if the decoder makes no progress
   - Add overflow checks before buffer resizing in `ByteArrayOutputStream` and 
`SocketOutputStream`
   
   This keeps existing behavior unchanged for normal cases while making buffer 
and stream handling safer under edge conditions.


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