Project

General

Profile

Bug #17810 » ruby-addr2line-do-not-overwrite-sname-with-null.patch

Do not overwrite sname with NULL - xtkoba (Tee KOBAYASHI), 04/17/2021 06:36 AM

View differences:

addr2line.c
/* if the binary is strip-ed, this may effect */
for (p=dladdr_fbases; *p; p++) {
if (*p == info.dli_fbase) {
lines[i].path = info.dli_fname;
lines[i].sname = info.dli_sname;
if (info.dli_fname) lines[i].path = info.dli_fname;
if (info.dli_sname) lines[i].sname = info.dli_sname;
goto next_line;
}
}
......
obj->base_addr = (uintptr_t)info.dli_fbase;
path = info.dli_fname;
obj->path = path;
lines[i].path = path;
lines[i].sname = info.dli_sname;
lines[i].saddr = (uintptr_t)info.dli_saddr;
if (path) lines[i].path = path;
if (info.dli_sname) {
lines[i].sname = info.dli_sname;
lines[i].saddr = (uintptr_t)info.dli_saddr;
}
strlcpy(binary_filename, path, PATH_MAX);
if (fill_lines(num_traces, traces, 1, &obj, lines, i) == (uintptr_t)-1)
break;
(1-1/2)