Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/symbolize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,10 @@ static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(
Dl_info info;
if (dladdr(pc, &info)) {
if (info.dli_sname) {
if (strlen(info.dli_sname) < out_size) {
strcpy(out, info.dli_sname);
int name_length = strlen(info.dli_sname);
if (name_length < out_size) {
memcpy(out, info.dli_sname, name_length);
out[name_length] = '\0';
// Symbolization succeeded. Now we try to demangle the symbol.
DemangleInplace(out, out_size);
return true;
Expand Down