From c257c5f0c75179a6c5e75d611b383980ffad1da1 Mon Sep 17 00:00:00 2001 From: Andrew Chong Date: Fri, 6 Sep 2019 16:49:09 +0800 Subject: [PATCH] mbed_error.c: Fixed another bug of possible stack overflow. --- platform/source/mbed_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/source/mbed_error.c b/platform/source/mbed_error.c index 8b7822dc37..bc16a3d8ed 100644 --- a/platform/source/mbed_error.c +++ b/platform/source/mbed_error.c @@ -509,7 +509,7 @@ static void print_stack_dump_core(uint32_t stack_start, uint32_t stack_size, uin mbed_error_printf("\n0x%08" PRIX32 ":", st); for (int i = 0; i < STACK_DUMP_WIDTH; i++) { uint32_t st_cur = st + i * sizeof(int); - if (st_cur > st_end) { + if (st_cur >= st_end) { break; } uint32_t st_val = *((uint32_t *)st_cur);