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

Add size validation when parsing values from VersionProps

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      java.lang.VersionProps defines a number of JDK version properties that are read by the VM and stored in JDK_Version or VM_Version. These values are read into fixed size buffers (thread.cpp):

      char java_version[64] = "";
      char java_runtime_name[128] = "";
      char java_runtime_version[128] = "";
      char java_runtime_vendor_version[128] = "";
      char java_runtime_vendor_vm_bug_url[128] = "";

      There is no guarantee that the value being read actually fits in these buffers.

      Update: we can bypass these buffers altogether - see comments

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dholmes David Holmes
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: