diff options
-rw-r--r-- | src/lib/ndpi_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index ad4638a64..e0150fe6c 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -8210,7 +8210,7 @@ static void ndpi_search_portable_executable(struct ndpi_detection_module_struct } uint32_t const pe_offset = le32toh(get_u_int32_t(packet->payload, 0x3C)); - if (packet->payload_packet_len <= pe_offset + 4 || + if ((u_int32_t)(packet->payload_packet_len - 4) <= pe_offset || be32toh(get_u_int32_t(packet->payload, pe_offset)) != pe_signature) { return; |