linux/trace: check for func/file == NULL
@@ -164,14 +164,14 @@ void arch_bfdResolveSyms(pid_t pid, funcs_t* funcs, size_t num) {
if (bfd_find_nearest_line(
bfdParams.bfdh, section, bfdParams.syms, sec_offset, &file, &func, &line) == TRUE) {
- snprintf(funcs[i].func, sizeof(funcs->func), "%s", func);
- snprintf(funcs[i].file, sizeof(funcs->file), "%s", file);
+ snprintf(funcs[i].func, sizeof(funcs->func), "%s", func ? func : "");
+ snprintf(funcs[i].file, sizeof(funcs->file), "%s", file ? file : "");
funcs[i].line = line;
}
if (bfd_find_nearest_line(
bfdParams.bfdh, section, bfdParams.syms, sec_offset, &file, &func, &line) == TRUE) {
- snprintf(funcs[i].func, sizeof(funcs->func), "%s", func);
- snprintf(funcs[i].file, sizeof(funcs->file), "%s", file);
+ snprintf(funcs[i].func, sizeof(funcs->func), "%s", func ? func : "");
+ snprintf(funcs[i].file, sizeof(funcs->file), "%s", file ? file : "");
funcs[i].line = line;
}
}
