From 4841207b5301dd8110ec844a8e1e7ea64cd2ffef Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 4 Dec 2023 17:28:41 -0800 Subject: [PATCH] Handle scudo_stack_depot_size = 0 Bug: 309446692 Change-Id: Ic55294316137847041f1e829cb0243aae8926379 --- debuggerd/libdebuggerd/scudo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/debuggerd/libdebuggerd/scudo.cpp b/debuggerd/libdebuggerd/scudo.cpp index c15bbeaca..17a1f79e3 100644 --- a/debuggerd/libdebuggerd/scudo.cpp +++ b/debuggerd/libdebuggerd/scudo.cpp @@ -41,8 +41,6 @@ ScudoCrashData::ScudoCrashData(unwindstack::Memory* process_memory, return; } - auto stack_depot = AllocAndReadFully(process_memory, process_info.scudo_stack_depot, - process_info.scudo_stack_depot_size); auto region_info = AllocAndReadFully(process_memory, process_info.scudo_region_info, __scudo_get_region_info_size()); std::unique_ptr ring_buffer; @@ -50,7 +48,12 @@ ScudoCrashData::ScudoCrashData(unwindstack::Memory* process_memory, ring_buffer = AllocAndReadFully(process_memory, process_info.scudo_ring_buffer, process_info.scudo_ring_buffer_size); } - if (!stack_depot || !region_info) { + std::unique_ptr stack_depot; + if (process_info.scudo_stack_depot_size != 0) { + stack_depot = AllocAndReadFully(process_memory, process_info.scudo_stack_depot, + process_info.scudo_stack_depot_size); + } + if (!region_info) { return; }