mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-05 14:05:50 +00:00
Merge remote-tracking branch 'origin/pr/2793' into mbedtls-2.16
* origin/pr/2793: Changelog entry Check for zero length and NULL buffer pointer
This commit is contained in:
commit
71db1de226
|
@ -28,6 +28,8 @@ Bugfix
|
||||||
* Improve code clarity in x509_crt module, removing false-positive
|
* Improve code clarity in x509_crt module, removing false-positive
|
||||||
uninitialized variable warnings on some recent toolchains (GCC8, etc).
|
uninitialized variable warnings on some recent toolchains (GCC8, etc).
|
||||||
Discovered and fixed by Andy Gross (Linaro), #2392.
|
Discovered and fixed by Andy Gross (Linaro), #2392.
|
||||||
|
* Zero length buffer check for undefined behavior in
|
||||||
|
mbedtls_platform_zeroize(). Fixes ARMmbed/mbed-crypto#49.
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h
|
* Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h
|
||||||
|
|
|
@ -72,6 +72,9 @@ static void * (* const volatile memset_func)( void *, int, size_t ) = memset;
|
||||||
|
|
||||||
void mbedtls_platform_zeroize( void *buf, size_t len )
|
void mbedtls_platform_zeroize( void *buf, size_t len )
|
||||||
{
|
{
|
||||||
|
MBEDTLS_INTERNAL_VALIDATE( len == 0 || buf != NULL );
|
||||||
|
|
||||||
|
if( len > 0 )
|
||||||
memset_func( buf, 0, len );
|
memset_func( buf, 0, len );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */
|
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */
|
||||||
|
|
Loading…
Reference in a new issue