Skip to content

Commit 67912b2

Browse files
committed
Minor improvement to UTF32Reader.read() bounds-checks
1 parent ecf5de2 commit 67912b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/fasterxml/jackson/core/io/UTF32Reader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public int read(char[] cbuf, int start, int len) throws IOException
106106
if (_buffer == null) { return -1; }
107107
if (len < 1) { return len; }
108108
// Let's then ensure there's enough room...
109-
if (start < 0 || (start+len) > cbuf.length) {
109+
if (start < 0 || len < 0 || start > (cbuf.length - len)) {
110110
reportBounds(cbuf, start, len);
111111
}
112112

0 commit comments

Comments
 (0)