diff options
author | midipix <writeonce@midipix.org> | 2017-02-11 22:45:44 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2017-02-11 22:45:44 -0500 |
commit | b6058660b9b7de60683310b268dfa285aad07912 (patch) | |
tree | 5b353f77fdbd72cc7605d800a3326f114c86e0f9 | |
parent | ced38ac90b6dd9cdcec5570cb13964bb4f886580 (diff) | |
download | perk-b6058660b9b7de60683310b268dfa285aad07912.tar.bz2 perk-b6058660b9b7de60683310b268dfa285aad07912.tar.xz |
pe_get_image_meta(): account for an empty symbol table.
-rw-r--r-- | src/logic/pe_get_image_meta.c | 8 |
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]; |