Fix out-of-bounds array access in tests-mbedmicro-rtos-mbed-malloc

pull/10977/head
Neil Tuttle 2019-06-24 16:27:10 -07:00 committed by Volodymyr Medvid
parent a415dfae2d
commit 81f85296e8
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ void test_alloc_and_free(void)
int size = SIZE_INCREMENTS;
int loop = ALLOC_LOOP;
while (loop) {
data = malloc(size);
data = count < ALLOC_ARRAY_SIZE ? malloc(size) : NULL;
if (NULL != data) {
array[count++] = data;
memset((void *)data, 0xdeadbeef, size);