diff options
author | Michele Campus <fci1908@gmail.com> | 2016-07-26 10:37:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 10:37:36 +0200 |
commit | 4fa76bee780fe2a8904000eecb9acd97d6717373 (patch) | |
tree | 96c062091fddfb6024d6d9968156ad18c1e67b67 | |
parent | da80bd8bb4c79e7e49724d3e86a13e8e83beed9a (diff) | |
parent | 384dee1f954e0f425fdba2e05c0642176e85592b (diff) |
Merge pull request #235 from theirix/fix-overflow-oscar
Fixed overflow in Oscar
-rw-r--r-- | src/lib/protocols/oscar.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/protocols/oscar.c b/src/lib/protocols/oscar.c index 8be944993..869b36378 100644 --- a/src/lib/protocols/oscar.c +++ b/src/lib/protocols/oscar.c @@ -244,11 +244,19 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct */ if (channel == DATA) { - family = get_u_int16_t(packet->payload, 6); + if (packet->payload_packet_len >= 8) + family = get_u_int16_t(packet->payload, 6); + else + family = 0; if (packet->payload_packet_len >= 10) type = get_u_int16_t(packet->payload, 8); else type = 0; + if (family == 0 || type == 0) + { + NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OSCAR); + return; + } /* Family 0x0001 */ if (family == htons(GE_SE_CTL)) |