summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-02-11 22:45:44 -0500
committermidipix <writeonce@midipix.org>2017-02-11 22:45:44 -0500
commitb6058660b9b7de60683310b268dfa285aad07912 (patch)
tree5b353f77fdbd72cc7605d800a3326f114c86e0f9 /src
parentced38ac90b6dd9cdcec5570cb13964bb4f886580 (diff)
downloadperk-b6058660b9b7de60683310b268dfa285aad07912.tar.bz2
perk-b6058660b9b7de60683310b268dfa285aad07912.tar.xz
pe_get_image_meta(): account for an empty symbol table.
Diffstat (limited to 'src')
-rw-r--r--src/logic/pe_get_image_meta.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index 9914013..cab566b 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -206,9 +206,11 @@ int pe_get_image_meta(
mark = (const unsigned char *)base + m->coff.cfh_ptr_to_sym_tbl;
mark += m->coff.cfh_num_of_syms * sizeof(struct pe_raw_coff_symbol);
- m->coff.cfh_ptr_to_str_tbl = m->coff.cfh_ptr_to_sym_tbl;
- m->coff.cfh_ptr_to_str_tbl += m->coff.cfh_num_of_syms * sizeof(struct pe_raw_coff_symbol);
- m->coff.cfh_size_of_str_tbl = pe_read_long(mark);
+ if (m->coff.cfh_ptr_to_sym_tbl) {
+ m->coff.cfh_ptr_to_str_tbl = m->coff.cfh_ptr_to_sym_tbl;
+ m->coff.cfh_ptr_to_str_tbl += m->coff.cfh_num_of_syms * sizeof(struct pe_raw_coff_symbol);
+ m->coff.cfh_size_of_str_tbl = pe_read_long(mark);
+ }
if (m->ados) {
mark = &m->acoff->cfh_signature[0];