mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 19:21:18 +00:00
Make malloc-0-null a user config file
Having a wrapper made it harder to use: incompatible with setting MBEDTLS_CONFIG_FILE, harder to combine with other settings. It was also surprising since it was the only test config that was structured in that way. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
36dea1501b
commit
cf4fe58fd0
@ -1,4 +1,4 @@
|
||||
/* mbedtls_config.h wrapper that forces calloc(0) to return NULL.
|
||||
/* mbedtls_config.h modifier that forces calloc(0) to return NULL.
|
||||
* Used for testing.
|
||||
*/
|
||||
/*
|
||||
@ -18,8 +18,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "mbedtls/mbedtls_config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef MBEDTLS_PLATFORM_STD_CALLOC
|
@ -3766,7 +3766,7 @@ component_test_platform_calloc_macro () {
|
||||
component_test_malloc_0_null () {
|
||||
msg "build: malloc(0) returns NULL (ASan+UBSan build)"
|
||||
scripts/config.py full
|
||||
make CC=gcc CFLAGS="'-DMBEDTLS_CONFIG_FILE=\"$PWD/tests/configs/config-wrapper-malloc-0-null.h\"' $ASAN_CFLAGS -O" LDFLAGS="$ASAN_CFLAGS"
|
||||
make CC=gcc CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"$PWD/tests/configs/user-config-malloc-0-null.h\"' $ASAN_CFLAGS -O" LDFLAGS="$ASAN_CFLAGS"
|
||||
|
||||
msg "test: malloc(0) returns NULL (ASan+UBSan build)"
|
||||
make test
|
||||
|
Loading…
x
Reference in New Issue
Block a user