Skip to content

Guard the second buffer write in parseComment (3.x) - #111

Merged
slachiewicz merged 1 commit into
3.xfrom
agent/comment-buffer-bounds-3x
Nov 8, 2026
Merged

slachiewicz merged 1 commit into
3.xfrom
agent/comment-buffer-bounds-3x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Port of #110 to the 3.x line: the second pc[pcEnd++] write in MXParser.parseComment, for the low surrogate of a supplementary character, lacked the capacity check the first write has, so a comment ending exactly at the buffer boundary threw ArrayIndexOutOfBoundsException. Fixes #103 on 3.x.

Verified: mvn -B verify on JDK 17 → green, including the new boundary test.

@slachiewicz slachiewicz added bug Something isn't working maintenance Cleanup, refactoring or other internal change labels Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 14:25
@slachiewicz
slachiewicz merged commit 6ad09e0 into 3.x Nov 8, 2026
13 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 maintenance Cleanup, refactoring or other internal change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant