diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2019-04-12 19:20:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 19:20:14 +0200 |
commit | 83d5627c4ddf02ae496d3ba1900d7f50ded8e4c0 (patch) | |
tree | 7f03cc7d0f48e8ac1a9c50c47390fc75d038ec5a /src/lib/protocols | |
parent | 6f8a01ca18e7fa9fe133c0ad7afb52bc194e2bba (diff) | |
parent | 7415af5086121c6196ad1dc9d0232b000f869ac0 (diff) |
Merge pull request #694 from pallas/avoid-csgo-short-read
csgo: fix invalid read on short packet
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/csgo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/protocols/csgo.c b/src/lib/protocols/csgo.c index 7f4479419..f316f96b7 100644 --- a/src/lib/protocols/csgo.c +++ b/src/lib/protocols/csgo.c @@ -30,6 +30,11 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n struct ndpi_packet_struct* packet = &flow->packet; if (packet->udp != NULL) { + if (packet->payload_packet_len < sizeof(uint32_t)) { + NDPI_LOG_DBG2(ndpi_struct, "Short csgo packet\n"); + return; + } + uint32_t w = htonl(get_u_int32_t(packet->payload, 0)); NDPI_LOG_DBG2(ndpi_struct, "CSGO: word %08x\n", w); |