mirror of https://github.com/ARMmbed/mbed-os.git
Fix out-of-bounds array access in tests-mbedmicro-rtos-mbed-malloc
parent
a415dfae2d
commit
81f85296e8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue