diff options
author | Luca Deri <deri@ntop.org> | 2017-02-25 06:31:07 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2017-02-25 06:31:07 +0100 |
commit | 889cdbff3c553789969b5f4d59a513dd0bf8bf4f (patch) | |
tree | 7b7f5363b31246fb8f5637117c958529528497ba /src | |
parent | a787287bfa02b8fe69d9b8655e9e27073d3a9a43 (diff) |
Fixed bug that can lkead to a crash in iqiyi dissector
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/http.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index e8b22a145..5ca47476a 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -841,9 +841,10 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct // additional field in http payload x = 1; while(packet->line[x].len != 0) { - if((memcmp(packet->line[x].ptr, "qyid", 4)) == 0 && - (memcmp(packet->line[x+1].ptr, "qypid", 5)) == 0 && - (memcmp(packet->line[x+2].ptr, "qyplatform", 10)) == 0) { + if(packet->line[x].ptr && ((memcmp(packet->line[x].ptr, "qyid", 4)) == 0) + && packet->line[x+1].ptr && ((memcmp(packet->line[x+1].ptr, "qypid", 5)) == 0) + && packet->line[x+2].ptr && ((memcmp(packet->line[x+2].ptr, "qyplatform", 10)) == 0) + ) { flow->l4.tcp.ppstream_stage++; iqiyi_counter++; check_content_type_and_change_protocol(ndpi_struct, flow); |