netliomax25-code opened a new pull request, #2717:
URL: https://github.com/apache/groovy/pull/2717

   Repro: write a lone low surrogate (a `\uDC00`-`\uDFFF` char with no 
preceding high surrogate) through StreamingMarkupBuilder, e.g. `new 
StreamingMarkupBuilder().bind { mkp.yield '\uDC00' }`.
   Cause: the low-surrogate branch in `write(int)` assumes a high surrogate was 
already buffered, so it reads `surrogatePair.charAt(0)` (the low surrogate 
itself) and emits a numeric character reference for an unrelated code point 
(`\uDC00` becomes `𐀀`) instead of failing.
   Fix: reject a low surrogate that is not preceded by a high surrogate, 
matching the existing rejection of a high surrogate not followed by a low one.
   


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