8278428: ObjectInputStream.readFully range check incorrect

Reviewed-by: alanb
This commit is contained in:
Roger Riggs 2021-12-08 20:37:41 +00:00
parent 5a80abf706
commit 8e8fadf2d4
2 changed files with 45 additions and 24 deletions

View file

@ -1204,7 +1204,7 @@ public class ObjectInputStream
* @throws IOException If other I/O error has occurred.
*/
public void readFully(byte[] buf, int off, int len) throws IOException {
Objects.checkFromToIndex(off, len, buf.length);
Objects.checkFromIndexSize(off, len, buf.length);
bin.readFully(buf, off, len, false);
}