Kernel: Stop walking the stack when we encounter return address 0

This commit is contained in:
Gunnar Beutner 2021-04-25 13:39:11 +02:00 committed by Andreas Kling
parent d164da7d19
commit 64639de4d2
Notes: sideshowbarker 2024-07-18 19:04:41 +09:00

View File

@ -45,6 +45,8 @@ static Vector<FlatPtr, PerformanceEvent::max_stack_frame_count> raw_backtrace(Fl
FlatPtr retaddr;
if (!safe_memcpy(&retaddr, (void*)(stack_ptr + sizeof(FlatPtr)), sizeof(FlatPtr), fault_at))
break;
if (retaddr == 0)
break;
backtrace.append(retaddr);
if (backtrace.size() == PerformanceEvent::max_stack_frame_count)
break;