Skip to content

Potential fix for code scanning alert no. 5: Incorrect allocation-error handling#173

Open
systems-assistant[bot] wants to merge 4 commits intodevelopfrom
import/develop/ROCm_aqlprofile/alert-autofix-5
Open

Potential fix for code scanning alert no. 5: Incorrect allocation-error handling#173
systems-assistant[bot] wants to merge 4 commits intodevelopfrom
import/develop/ROCm_aqlprofile/alert-autofix-5

Conversation

@systems-assistant
Copy link
Contributor

Potential fix for https://github.com/AMD-ROCm-Internal/aqlprofile/security/code-scanning/5

To fix the issue, the redundant null pointer check after should be removed. Instead, the allocation failure should be handled using a block to catch the exception, which is the standard mechanism for handling allocation errors in C++. This ensures that the code adheres to C++ best practices and avoids misleading constructs.

Detailed steps:

  1. Remove the null pointer check for on line 146.
  2. Wrap the allocation of (line 144) in a block to handle the exception.
  3. If an exception is caught, log or handle the error appropriately, such as setting a flag or rethrowing the exception, depending on the desired behavior.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.


🔁 Imported from ROCm/aqlprofile#16
🧑‍💻 Originally authored by @rocm-devops

bgopesh and others added 4 commits July 18, 2025 19:29
…or handling

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ammallya pushed a commit that referenced this pull request Aug 7, 2025
[ROCm/rocprofiler-sdk commit: 075d36e]
ywang103-amd pushed a commit to ywang103-amd/rocm-systems that referenced this pull request Aug 7, 2025
Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.1 to 44.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@43.0.1...44.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 44.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[ROCm/rocprofiler-systems commit: cbc0080]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants