8306959: (bf) CharBuffer.append(CharSequence,int,int) throws BufferOverflowException where IndexOutOfBoundsException expected

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2023-04-27 17:20:08 +00:00
parent eb358619df
commit 80fae514b1
11 changed files with 387 additions and 11 deletions

View file

@ -289,6 +289,8 @@ class Heap$Type$Buffer$RW$
private $Type$Buffer appendChars(CharSequence csq, int start, int end) {
checkSession();
Objects.checkFromToIndex(start, end, csq.length());
int length = end - start;
int pos = position();
int lim = limit();