RFR: 8300038: Make new version of JNU_GetStringPlatformChars which checks for null characters [v3]
Michael McMahon
michaelm at openjdk.org
Wed May 24 10:14:23 UTC 2023
> This PR creates a new version of the JNI utility function JNU_GetStringPlatformChars called JNU_GetStringPlatformCharsStrict, which performs additional validation of the returned string, namely that it does not contain any embedded NULL characters. If any such characters are found the function returns NULL with an IAE pending. The change also switches usage in the networking native code to use the new function.
>
> This cautious approach was taken rather than changing the behavior of the existing function as each native code area needs to review the effect of making the switch. Otherwise, surprising behavior changes might occur (eg undocumented IAE being thrown to user code instead of some other exception).
Michael McMahon has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
- Merge branch 'master' into nullStrings
- test comment update
- test update
- Merge branch 'master' into nullStrings
- exception message update
- test update
- remve whitespace
- update
- Merge branch 'master' into nullStrings
- first impl
-------------
Changes: https://git.openjdk.org/jdk/pull/14083/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14083&range=02
Stats: 183 lines in 9 files changed: 163 ins; 1 del; 19 mod
Patch: https://git.openjdk.org/jdk/pull/14083.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14083/head:pull/14083
PR: https://git.openjdk.org/jdk/pull/14083
More information about the core-libs-dev
mailing list