Merge pull request #10977 from vmedcy/tests-mbedmicro-rtos-mbed-malloc

Fix out-of-bounds array access in tests-mbedmicro-rtos-mbed-malloc
pull/10990/head
Arto Kinnunen 2019-07-08 16:39:22 +03:00 committed by GitHub
commit cd4283e5fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);