Skip to content

Commit

Permalink
8322877: java/io/BufferedInputStream/TransferTo.java failed with Inde…
Browse files Browse the repository at this point in the history
…xOutOfBoundsException

Reviewed-by: alanb, stsypanov
  • Loading branch information
Brian Burkhalter committed Jan 3, 2024
1 parent 30a0c61 commit 54b3cee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/io/BufferedInputStream.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -644,7 +644,7 @@ private long implTransferTo(OutputStream out) throws IOException {
int avail = count - pos;
if (avail > 0) {
if (isTrusted(out)) {
out.write(getBufIfOpen(), pos, count);
out.write(getBufIfOpen(), pos, avail);
} else {
// Prevent poisoning and leaking of buf
byte[] buffer = Arrays.copyOfRange(getBufIfOpen(), pos, count);
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ java/lang/instrument/RetransformBigClass.sh 8065756 generic-
# jdk_io

java/io/pathNames/GeneralWin32.java 8180264 windows-all
java/io/BufferedInputStream/TransferTo.java 8322877 generic-all

############################################################################

Expand Down

1 comment on commit 54b3cee

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.