summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-09 06:56:05 +0000
committermidipix <writeonce@midipix.org>2021-04-09 07:11:47 +0000
commit44ba87393046804e3661da9cf9c8e639b82c5cf0 (patch)
tree99494fc76e23ff6dca37e3977363bd56e18a60bd
parentb0b2afdb236472030084d2888147724bb4b90de5 (diff)
downloadperk-44ba87393046804e3661da9cf9c8e639b82c5cf0.tar.bz2
perk-44ba87393046804e3661da9cf9c8e639b82c5cf0.tar.xz
output: header dump: pe_hdrdump_import_tbl(): properly handle coff objects.
-rw-r--r--src/hdrdump/pe_hdrdump_import_tbl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hdrdump/pe_hdrdump_import_tbl.c b/src/hdrdump/pe_hdrdump_import_tbl.c
index 252352c..8874266 100644
--- a/src/hdrdump/pe_hdrdump_import_tbl.c
+++ b/src/hdrdump/pe_hdrdump_import_tbl.c
@@ -98,6 +98,9 @@ int pe_hdrdump_import_tbl(
{
int idx;
+ if (meta->m_stats.t_nimplibs == 0)
+ return 0;
+
for (idx=0; idx<=meta->m_stats.t_nimplibs; idx++)
if (pe_hdrdump_import_hdr_impl(dctx,meta,idx) < 0)
return PERK_NESTED_ERROR(dctx);