From 1673a305cf827e668f308c7f28e287cd76f1f8b3 Mon Sep 17 00:00:00 2001 From: Ivan Stepanov Date: Thu, 30 Jul 2026 14:32:51 +0200 Subject: [PATCH] fix #1438 null dereference in dwarf --- public/libbacktrace/dwarf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/libbacktrace/dwarf.cpp b/public/libbacktrace/dwarf.cpp index 52fa8a8d..d45280a7 100644 --- a/public/libbacktrace/dwarf.cpp +++ b/public/libbacktrace/dwarf.cpp @@ -3965,7 +3965,7 @@ report_inlined_functions (uintptr_t pc, struct function *function, const char* c return ret; /* Report this inlined call. */ - if (*filename[0] != '/' && comp_dir) + if (*filename && *filename[0] != '/' && comp_dir) { char buf[1024]; snprintf (buf, 1024, "%s/%s", comp_dir, *filename); @@ -4246,7 +4246,7 @@ dwarf_lookup_pc (struct backtrace_state *state, struct dwarf_data *ddata, if (ret != 0) return ret; - if (filename[0] != '/' && entry->u->comp_dir) + if (filename && filename[0] != '/' && entry->u->comp_dir) { char buf[1024]; snprintf (buf, 1024, "%s/%s", entry->u->comp_dir, filename);