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

Do not use NULL pointer as write buffer parameter in jfrEmergencyDump.cpp write_repository_files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr
    • Resolved In Build:
      b10
    • CPU:
      generic
    • OS:
      generic

      Description

      In jfrEmergencyDump.cpp write_repository_files, potentially (when malloc fails) a NULL pointer is passed as second (buffer) parameter to os::write .
      This is unwanted, see also the Sonar finding :

      https://sonarcloud.io/project/issues?id=shipilev_jdk&languages=cpp&open=AXck7_SvBBG2CXpcnJEx&resolved=false&severities=CRITICAL&types=BUG

      bytes_written += (int64_t)os::write(emergency_fd, copy_block, bytes_read - bytes_written);

      Sonar: Null pointer passed as read buffer "copy_block" in call to "write"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mbaesken Matthias Baesken
              Reporter:
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: