Use a null pointer for empty data #338

Open
gilles-peskine-arm wants to merge 1 commit from gilles-peskine-arm/test-data_t-empty_is_empty-crypto into development
gilles-peskine-arm commented 2025-06-26 11:41:55 -05:00 (Migrated from github.com)

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.

PR checklist

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. ## PR checklist - [x] **changelog** not required because: test only - [x] **development PR** not required because: no reliance on the old behavior - [x] **TF-PSA-Crypto PR** here - [x] **framework PR** https://github.com/Mbed-TLS/mbedtls-framework/pull/177 (needs to be merged after 3.6 and crypto are updated) - [x] **3.6 PR** https://github.com/Mbed-TLS/mbedtls/pull/10257 - **tests** provided
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto:gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'development'
git merge --no-ff 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git rebase 'development'
git switch 'development'
git merge --ff-only 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git rebase 'development'
git switch 'development'
git merge --no-ff 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'development'
git merge --squash 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'development'
git merge --ff-only 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git switch 'development'
git merge 'gilles-peskine-arm/test-data_t-empty_is_empty-crypto'
git push origin 'development'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto!338
No description provided.