Skip to content
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

psa_wipe_tag_output_buffer: Bail if the buffer is NULL. #9839

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant