Skip to content

Use a null pointer for empty data #177

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: main
Choose a base branch
from

Conversation

gilles-peskine-arm
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm commented Jun 26, 2025

In binary arguments to test functions, don't allocate an extra byte when a binary input is empty. This could hide bugs where the library tries to access one byte in an empty buffer.

Needs preceding PR: 3.6 and crypto to stop using mbedtls_test_zero_alloc() first.

PR checklist

Don't allocate an extra byte when a binary input is empty. This could hide
bugs where the library tries to access one byte in an empty buffer.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added the needs-preceding-pr Requires another PR to be merged first label Jun 26, 2025
@gilles-peskine-arm gilles-peskine-arm added needs-ci Needs to pass CI tests priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci Needs to pass CI tests needs-preceding-pr Requires another PR to be merged first 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.

1 participant