RFR: JDK-8312612: handle WideCharToMultiByte return values [v2]

Matthias Baesken mbaesken at openjdk.org
Fri Jul 28 11:35:50 UTC 2023


On Fri, 28 Jul 2023 09:58:01 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> The function WideCharToMultiByte is used at a number of places of the JDK codebase for conversion purposes.
>> Unfortunately, the function might fail because of various reasons, so the return value must be checked to avoid undefined behavior or even crashes.
>> see
>> https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte
>> especially
>> https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte#return-value
>> 
>> At most places in the coding the return values are already checked, but some are missing.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   small adjustments

Hi Christoph, thanks for the review.
The Windows aarch64 build errors seems to be unrelated (but should maybe still be addressed, but other issue).

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

PR Comment: https://git.openjdk.org/jdk/pull/15015#issuecomment-1655530976



More information about the client-libs-dev mailing list