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

   ### Summary
   
   Fix the UTF-8 recovery path to safely handle malformed input at end-of-input 
without dereferencing the end iterator.
   
   ### Root Cause
   
   - The UTF-8 recovery loop advanced the iterator and immediately dereferenced 
it.
   - When a malformed UTF-8 sequence occurred at the end of the input, `++iter` 
could reach `src.end()`.
   - The subsequent dereference resulted in undefined behavior.
   
   ### Fix
   
   - Add an explicit end-of-input check before dereferencing the iterator 
during UTF-8 recovery.
   - Preserve the existing behavior of skipping continuation bytes and emitting 
a replacement character for malformed input.


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