Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8312612

Handle WideCharToMultiByte return values

XMLWordPrintable

    • b09
    • generic
    • windows

        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.

              mbaesken Matthias Baesken
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: