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

Avoid redundant native memory allocation in getFinalPath()

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      master
    • OS:
      windows

      Description

      src/java.base/windows/native/libjava/WinNTFileSystem_md.c

      If the path starts with "//?/" we allocate new memory block only to copy a porting of the path.

      The new memory is needed because copying is done via wcscpy(), which cannot deal with overlapping memory regions.
      Instead we can use wmemmove(), which handles overlapping memory correctly and avoid allocating a new memory block.

        Attachments

          Activity

            People

            • Assignee:
              igerasim Ivan Gerasimov
              Reporter:
              igerasim Ivan Gerasimov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: