Skip to content

Commit

Permalink
fix(espcoredump): prevent null pointer dereference in panic reason ha…
Browse files Browse the repository at this point in the history
…ndling
  • Loading branch information
erhankur committed Dec 9, 2024
1 parent 512b16a commit 8bfabe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/esp_system/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,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);
Expand Down Expand Up @@ -299,7 +299,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) {
Expand Down

0 comments on commit 8bfabe7

Please sign in to comment.