diff options
Diffstat (limited to 'src/reader/pe_read_coff_header.c')
-rw-r--r-- | src/reader/pe_read_coff_header.c | 5 |
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) |