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

   ## Summary
   
   Fix JSONLayout escaping for malformed UTF-8 input.
   
   Previously, malformed decoded input could bypass replacement escaping and 
preserve the original malformed bytes in emitted JSON output. This happened 
because the replacement character (`U+FFFD`) incorrectly followed the printable 
fast path.
   
   This change ensures malformed decoded input and invalid Unicode scalar 
values are consistently emitted through the JSON escaping path as `\ufffd`.
   
   ## Changes
   
   - Add `escapeReplacement` handling in `JSONLayout::appendItem()`
   - Ensure replacement characters bypass the printable fast path
   - Preserve existing behavior for valid UTF-8 input
   - Add regression coverage for malformed UTF-8 escaping behavior
   
   ## Regression Test
   
   Added a focused regression test for malformed UTF-8 input to verify 
malformed bytes no longer survive into JSON output and are emitted as escaped 
replacement characters instead.


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