RFR: 8308748: JNU_GetStringPlatformChars may write to String's internal memory array [v2]
David Holmes
dholmes at openjdk.org
Mon May 29 02:52:54 UTC 2023
On Sat, 27 May 2023 14:21:28 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> This looks okay. Have you checked the other usages of ReleasePrimitiveArrayCritical (e.g. libzip) see if they need the copy back when releasing?
I can immediately see code in `Java_java_util_zip_Inflater_inflateBytesBytes` that needs the same fix in relation to the input array. Even if there is no issue with read-only memory when writing back an unchanged array, we should avoid unnecessary copying.
That said I'm not sure it is up to this issue/PR to take responsibility for policing all uses of `ReleasePrimitiveArrayCritical` in the JDK libraries.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14117#issuecomment-1566418737
More information about the core-libs-dev
mailing list