Avoid redundant native memory allocation in getFinalPath()

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 12
    • Affects Version/s: None
    • Component/s: core-libs
    • b03
    • windows

      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.

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

              Created:
              Updated:
              Resolved: