Skip to content

Fix ArrayIndexOutOfBoundsException for surrogate pair in comment at buffer boundary - #110

Merged
slachiewicz merged 1 commit into
masterfrom
agent/comment-buffer-bounds
Nov 8, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/comment-buffer-bounds

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

MXParser.parseComment checked for room for one char and then wrote two when a comment holds a supplementary character; it now checks before the second write. parsePI and parseCDSect read single chars only and do not share the pattern.

Fixes #103

Verified: mvn -B -ntp verify → 218 tests, 0 failures; the new test throws Index 8192 out of bounds without the fix.

@slachiewicz slachiewicz added the bug Something isn't working label Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 14:25
@slachiewicz
slachiewicz merged commit 01ac5b9 into master Nov 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArrayIndexOutOfBoundsException in MXParser.parseComment

1 participant