Undefined behavior in mbedtls_platform_zeroize() #49

Closed
opened 2019-02-11 08:22:07 -06:00 by Patater · 1 comment
Patater commented 2019-02-11 08:22:07 -06:00 (Migrated from github.com)

Description

Calling memset() with a non-NULL buffer argument is undefined in C. mbedtls_platform_zeroize() can end up calling memset() directly (via a function pointer). It might be good to make mbedtls_platform_zeroize() have defined behavior when the buffer argument in NULL and size is 0.

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug
### Description Calling `memset()` with a non-NULL buffer argument is undefined in C. mbedtls_platform_zeroize() can end up calling `memset()` directly (via a function pointer). It might be good to make `mbedtls_platform_zeroize()` have defined behavior when the buffer argument in NULL and size is 0. ### Issue request type [ ] Question [ ] Enhancement [x] Bug
ciarmcom commented 2019-02-11 15:42:04 -06:00 (Migrated from github.com)

Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-672

*Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-672*
Sign in to join this conversation.
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-ARMmbed/mbed-crypto#49
No description provided.