GElf_Shdr header_mem;
GElf_Shdr* symtab_sheader = gelf_getshdr(symtab_section,
&header_mem);
+
+ // check for bogus section header
+ if (symtab_sheader->sh_entsize == 0)
+ return false;
+
size_t nb_syms = symtab_sheader->sh_size / symtab_sheader->sh_entsize;
Elf_Data* symtab = elf_getdata(symtab_section, 0);
"output/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi",
},
#endif
+ {
+ "data/test-read-dwarf/test25-bogus-binary.elf",
+ "",
+ "",
+ "",
+ },
// This should be the last entry.
{NULL, NULL, NULL, NULL}
};
set_suppressions(*ctxt, in_suppr_spec_path);
abigail::corpus_sptr corp = read_corpus_from_elf(*ctxt, status);
+ // if there is no output and no input, assume that we do not care about the
+ // actual read result, just that it succeeded.
+ if (in_abi_path.empty() && out_abi_path.empty()) {
+ // Phew! we made it here and we did not crash! yay!
+ return;
+ }
if (!corp)
{
error_message = string("failed to read ") + in_elf_path + "\n";