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"
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"