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

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 17
    • 17
    • hotspot
    • None
    • jfr
    • b10
    • generic
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: