From 7d801c1d9c3b30bcfcb7207f84dfae7395224781 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 14 Dec 2015 06:19:33 -0500 Subject: strict-aliasing rule compliance. --- src/logic/pe_get_image_meta.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/logic') 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))))) -- cgit v1.2.3