RFR: 8299684: (bf) JNI direct buffer functions with large capacity behave unexpectedly [v4]

Brian Burkhalter bpb at openjdk.org
Tue Jan 10 02:20:43 UTC 2023


On Mon, 9 Jan 2023 08:42:58 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> test/jdk/java/nio/jni/NewDirectByteBuffer.java line 49:
>> 
>>> 47:         1L,
>>> 48:         (long)Integer.MAX_VALUE - 1,
>>> 49:         (long)Integer.MAX_VALUE
>> 
>> Won't such large capacities trigger OOME?
>
>> Won't such large capacities trigger OOME?
> 
> The malloc might fail, in which case the value of NULL will be passed to NewDirectByteBuffer. It needs to check the return from malloc.

Fixed in d2386a4b73f0fa4eb9cc278b3cbb1578e6cb4b55.

-------------

PR: https://git.openjdk.org/jdk/pull/11873


More information about the hotspot-dev mailing list