fix(espcoredump): prevent null pointer dereference in panic reason handling

This commit is contained in:
Erhan Kurubas
2024-11-30 15:15:01 +01:00
parent 8e0d94987d
commit 1011ab5f6d

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -223,7 +223,7 @@ static inline void disable_all_wdts(void)
wdt_hal_write_protect_enable(&wdt0_context);
#if SOC_TIMER_GROUPS >= 2
//Interupt WDT is the Main Watchdog Timer of Timer Group 1
//Interrupt WDT is the Main Watchdog Timer of Timer Group 1
wdt_hal_write_protect_disable(&wdt1_context);
wdt_hal_disable(&wdt1_context);
wdt_hal_write_protect_enable(&wdt1_context);
@@ -301,7 +301,7 @@ void esp_panic_handler(panic_info_t *info)
char *panic_reason_str = NULL;
if (info->pseudo_excause) {
panic_reason_str = (char *)info->reason;
} else if (g_panic_abort && strlen(g_panic_abort_details)) {
} else if (g_panic_abort) {
panic_reason_str = g_panic_abort_details;
}
if (panic_reason_str) {