RFR: JDK-8292866: Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation check MultiByteToWideChar return value for failures

Matthias Baesken mbaesken at openjdk.org
Thu Aug 25 08:09:08 UTC 2022


https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
states about MultiByteToWideChar : "The function returns 0 if it does not succeed" and lists a few failure cases.
However we miss checking the failure case in Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation , seems we assume the function always works nicely (in most of the JDK coding the return value is checked ).

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

Commit messages:
 - JDK-8292866

Changes: https://git.openjdk.org/jdk/pull/10015/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10015&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8292866
  Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/10015.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10015/head:pull/10015

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



More information about the client-libs-dev mailing list