< prev index next >
src/java.base/share/classes/java/io/StringBufferInputStream.java
Print this page
rev 15329 : imported patch 8163518-Integer-overflow-in-StringBufferInputStream-read-byte-int-int
*** 116,127 ****
throw new IndexOutOfBoundsException();
}
if (pos >= count) {
return -1;
}
! if (pos + len > count) {
! len = count - pos;
}
if (len <= 0) {
return 0;
}
String s = buffer;
--- 116,129 ----
throw new IndexOutOfBoundsException();
}
if (pos >= count) {
return -1;
}
!
! int avail = count - pos;
! if (len > avail) {
! len = avail;
}
if (len <= 0) {
return 0;
}
String s = buffer;
< prev index next >