summaryrefslogtreecommitdiffhomepage
path: root/src/reader
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/reader
parent4eb4f9a7602f4397d75396f76a13c636c451dcfc (diff)
downloadperk-7d801c1d9c3b30bcfcb7207f84dfae7395224781.tar.bz2
perk-7d801c1d9c3b30bcfcb7207f84dfae7395224781.tar.xz
strict-aliasing rule compliance.
Diffstat (limited to 'src/reader')
-rw-r--r--src/reader/pe_read_coff_header.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reader/pe_read_coff_header.c b/src/reader/pe_read_coff_header.c
index 79ed730..a0a0b7f 100644
--- a/src/reader/pe_read_coff_header.c
+++ b/src/reader/pe_read_coff_header.c
@@ -6,8 +6,9 @@
int pe_read_coff_header(const struct pe_coff_file_hdr * p, struct pe_meta_coff_file_hdr * m)
{
- if ((p->signature[0] != 'P') || (p->signature[1] != 'E')
- || *(uint16_t *)&p->signature[2])
+ uint16_t * pzero = (uint16_t *)&p->signature[2];
+
+ if ((p->signature[0] != 'P') || (p->signature[1] != 'E') || *pzero)
return PERK_BAD_COFF_HEADER;
#if (BYTE_ORDER == LITTLE_ENDIAN)