Use a null pointer for empty data #177

Open
gilles-peskine-arm wants to merge 1 commit from gilles-peskine-arm/test-data_t-empty_is_empty-framework into main
gilles-peskine-arm commented 2025-06-26 11:39:24 -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.

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

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. Needs preceding PR: 3.6 and crypto to stop using `mbedtls_test_zero_alloc()` first. ## PR checklist - [x] **changelog** not required because: test only - [ ] **development PR** TODO (or not required?) - [x] **TF-PSA-Crypto PR** https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/338 - [x] **framework PR** here - [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-framework:gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'

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 'main'
git merge --no-ff 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git rebase 'main'
git switch 'main'
git merge --ff-only 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git rebase 'main'
git switch 'main'
git merge --no-ff 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'main'
git merge --squash 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'main'
git merge --ff-only 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git switch 'main'
git merge 'gilles-peskine-arm/test-data_t-empty_is_empty-framework'
git push origin 'main'
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/mbedtls-framework!177
No description provided.