Skip to content

psa_wipe_tag_output_buffer: Bail if the buffer is NULL. #9839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ucko
Copy link
Contributor

@ucko ucko commented Dec 10, 2024

Description

Cleaning up after memory allocation failures can notably result in passing NULL buffers alongside nonzero sizes. Drop now-redundant guards from the two call sites that had them.

Clang's static analyzer caught this possibility, as noted by my colleague @SergeySatskiy.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog not required because: simple corner-case bug fix
  • development PR provided here
  • framework PR not required
  • 3.6 PR to follow if accepted
  • 2.28 PR not required because: no such function there (factored out later)
  • tests not required because: bug manifests only when out of memory

Cleaning up after memory allocation failures can notably result in
passing NULL buffers alongside nonzero sizes.  Drop now-redundant
guards from the two call sites that had them.

Signed-off-by: Aaron M. Ucko <[email protected]>
@minosgalanakis minosgalanakis added needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review component-psa PSA keystore/dispatch layer (storage, drivers, …) priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-psa PSA keystore/dispatch layer (storage, drivers, …) needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: In Development
Development

Successfully merging this pull request may close these issues.

2 participants