From e3c7eb271d2e3b1228b021e621f8e9c6c5c2e714 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Thu, 2 Mar 2023 15:50:50 +0100 Subject: [PATCH] fix (panic): added check if the current symbol was found by the resolver --- kernel/src/utils/panic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/src/utils/panic.c b/kernel/src/utils/panic.c index 3eb77d9..078d3e4 100644 --- a/kernel/src/utils/panic.c +++ b/kernel/src/utils/panic.c @@ -80,7 +80,13 @@ void panic_log_registers(cpu_state_T* state) { void panic_log_call_stack(cpu_state_T* state) { log(LOG_NONE, "Call Stack:"); stack_trace_call_stack(state->rbp); - stack_dump_call_info(state->rip, symbol_resolve_function_from_rip(g_kernel_executable->symbols, g_kernel_executable->num_symbols, state->rip)); + + symbol_T* symbol = symbol_resolve_function_from_rip(g_kernel_executable->symbols, g_kernel_executable->num_symbols, state->rip); + if (symbol != NULL) { + stack_dump_call_info(state->rip, symbol); + } else { + log(LOG_NONE, " 0x%x -> ", state->rip); + } } void panic(cpu_state_T* state, string_t message) {