diff options
author | Luca Deri <deri@ntop.org> | 2020-10-27 08:48:12 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-10-27 08:48:12 +0100 |
commit | 94471193c2082194e5be5a5096eef1784fc16b28 (patch) | |
tree | 121420d18fe07e1108a05fa77d14060a623bc142 /src/lib | |
parent | ba6a48c9fec64b0e3617f7f7f1f6afeedd8b6437 (diff) |
Added boundary check
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/protocols/skype.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/protocols/skype.c b/src/lib/protocols/skype.c index 22d94c021..a8f1529a0 100644 --- a/src/lib/protocols/skype.c +++ b/src/lib/protocols/skype.c @@ -108,7 +108,11 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s const uint8_t id_flags_iv_crc_len = 11; const uint8_t crc_len = sizeof(flow->l4.udp.skype_crc); const uint8_t crc_offset = id_flags_iv_crc_len - crc_len; - if ((payload_len >= id_flags_iv_crc_len) && (packet->payload[2] == 0x02 /* Payload flag */ ) && !flow->extra_packets_func) { + + if ((payload_len >= id_flags_iv_crc_len) + && (packet->payload[2] == 0x02 /* Payload flag */ ) + && (payload_len >= (crc_offset+crc_len)) + && (!flow->extra_packets_func)) { flow->check_extra_packets = 1; flow->max_extra_packets_to_check = 5; flow->extra_packets_func = ndpi_check_skype_udp_again; |