Skip to content

Commit e6bb0f6

Browse files
Copilotpjfanning
andcommitted
Revert to using reportBounds instead of Objects.checkFromIndexSize in UTF32Reader
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
1 parent d0b9445 commit e6bb0f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/tools/jackson/core/io/UTF32Reader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ public int read() throws IOException {
114114
public int read(char[] cbuf, int start, int len) throws IOException
115115
{
116116
Objects.requireNonNull(cbuf, "cbuf");
117-
Objects.checkFromIndexSize(start, len, cbuf.length);
118117
// Already EOF?
119118
if (_buffer == null) { return -1; }
120119
if (len < 1) { return len; }
120+
// Let's then ensure there's enough room...
121+
if (start < 0 || len < 0 || start > (cbuf.length - len)) {
122+
reportBounds(cbuf, start, len);
123+
}
121124

122125
int outPtr = start;
123126
final int outEnd = len+start;

0 commit comments

Comments
 (0)