Under some circumstances, eina crashes when attempting to display the
backtrace, because dladdr() may yield a dli_fname that is NULL. This is
especially annoying in realease, when the backtrace is shown by default
when CRI/ERR are thrown.
@fix
offset = base = 0;
// we have little choice but to hope/assume dladdr() doesn't alloc
// anything here
- if ((dladdr(bt[i], &info)) && (info.dli_fname[0]))
+ if ((dladdr(bt[i], &info)) && (info.dli_fname) && (info.dli_fname[0]))
{
offset = (unsigned long long)(uintptr_t)bt[i];
base = (unsigned long long)(uintptr_t)info.dli_fbase;