diff --git a/src/p_vmlinx.cpp b/src/p_vmlinx.cpp index 0039e721..6c664d59 100644 --- a/src/p_vmlinx.cpp +++ b/src/p_vmlinx.cpp @@ -108,7 +108,8 @@ typename T::Shdr const *PackVmlinuxBase::getElfSections() if (ehdri.e_shentsize != sizeof(*shdri) || file_size_u < ehdri.e_shoff || file_size_u < ehdri.e_shoff + mem_size(ehdri.e_shentsize, e_shnum)) { - throwCantPack("bad ElfXX_Shdrs"); + infoWarning("bad ElfXX_Shdrs"); + return nullptr; } shdri = new Shdr[(unsigned) e_shnum]; fi->seek(ehdri.e_shoff, SEEK_SET); @@ -117,7 +118,8 @@ typename T::Shdr const *PackVmlinuxBase::getElfSections() if (e_shnum <= e_shstrndx) { char msg[50]; snprintf(msg, sizeof(msg), "bad .e_shstrndx %#x", e_shstrndx); - throwCantPack(msg); + infoWarning(msg); + return nullptr; } Shdr const *p = &shdri[e_shstrndx]; if (Shdr::SHT_STRTAB==p->sh_type @@ -130,7 +132,8 @@ typename T::Shdr const *PackVmlinuxBase::getElfSections() if (p->sh_size <= p->sh_name) { char msg[50]; snprintf(msg, sizeof(msg), "bad .shstrtab _Shdr[%u]", (unsigned)ehdri.e_shstrndx); - throwCantPack(msg); + infoWarning(msg); + return nullptr; } shstrtab = new char[1+ p->sh_size]; fi->seek(p->sh_offset, SEEK_SET);