From: Ryan S. <ry...@gm...> - 2015-05-01 23:39:09
|
I've hit a null pointer dereference in libdwarf when opening a particular ELF file. The crash is in _dwarf_elf_relocate, specifically here: http://sourceforge.net/p/elftoolchain/code/HEAD/tree/trunk/libdwarf/libdwarf_elf_init.c#l141 ed->ed_data->d_buf is NULL here. I single stepped with gdb and found that this can from elf_getdata() returning a non-NULL ed_data with d_buf is set to NULL at this line: http://sourceforge.net/p/elftoolchain/code/HEAD/tree/trunk/libelf/elf_data.c#l143 I have no idea where to go from here. My test app source can be found here: https://people.freebsd.org/~rstone/libdwarf_crash/crash.c A sample ELF file that provokes the crash can be found here: https://people.freebsd.org/~rstone/libdwarf_crash/dwarf_crash.ko.debug |