mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-27 01:19:02 +00:00
Prior to this commit, AbstractXMLStreamReader.getTextCharacters(int sourceStart, char[], int, int) capped the copy length with Math.min(length, source.length), ignoring sourceStart. When sourceStart > 0 and sourceStart + length exceeds the text length, System.arraycopy read past the end of the source array and threw ArrayIndexOutOfBoundsException, contrary to the XMLStreamReader#getTextCharacters contract (copy up to length characters starting at sourceStart and return the number copied). To address that, this commit caps the length by the number of characters remaining from sourceStart. Closes gh-36914 Signed-off-by: junhyeong9812 <pickjog@gmail.com>