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

Use GetTempPath2 API instead of GetTempPath

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • None
    • hotspot
    • generic
    • windows

      Use the `GetTempPath2` APIs instead of the `GetTempPath` APIs in native code across the OpenJDK repository to retrieve the temporary directory path, as `GetTempPath2` provides enhanced security. While `GetTempPath` may still function without errors, using `GetTempPath2` reduces the risk of potential exploits for users.

      Note that `GetTempPath2` is only available on Windows 11 and later. Therefore, you should load it dynamically and fall back to `GetTempPath` if `GetTempPath2` is not available.

            dhanalla Dhamoder Nalla
            dhanalla Dhamoder Nalla
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: