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

Avoid redundant native memory allocation in getFinalPath()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 12
    • None
    • 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.

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

              Created:
              Updated:
              Resolved: