summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-12-14 06:19:33 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:33 -0500
commit7d801c1d9c3b30bcfcb7207f84dfae7395224781 (patch)
treecff38abb4c0ecf27054bf22d2a2c4a4d1f679cc3 /src/logic
parent4eb4f9a7602f4397d75396f76a13c636c451dcfc (diff)
downloadperk-7d801c1d9c3b30bcfcb7207f84dfae7395224781.tar.bz2
perk-7d801c1d9c3b30bcfcb7207f84dfae7395224781.tar.xz
strict-aliasing rule compliance.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/pe_get_image_meta.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index 78b8b91..699b3a2 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -141,9 +141,14 @@ int pe_get_image_meta(const struct pe_raw_image * image, struct pe_image_meta **
+ m->idata[i].import_lookup_tbl_rva - m->hidata->virtual_addr);
/* items */
+ uint32_t * hint;
m->idata[i].count = 0;
+
if (m->idata[i].import_lookup_tbl_rva) {
- for (pitem=m->idata[i].aitems; *(uint32_t *)pitem->hint_name_tbl_rva; pitem++)
+ pitem = m->idata[i].aitems;
+ hint = (uint32_t *)pitem->hint_name_tbl_rva;
+
+ for (; *hint; hint=(uint32_t *)((++pitem)->hint_name_tbl_rva))
m->idata[i].count++;
if (!(m->idata[i].items = calloc(m->idata[i].count,sizeof(*(m->idata[i].items)))))