diff options
author | Luca Deri <deri@ntop.org> | 2020-06-26 22:37:52 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-06-26 22:37:52 +0200 |
commit | 8566288e43d0097f7739f1a9fc3eaa0631853ae6 (patch) | |
tree | 021b026ed94b94aaadf04aca97bf7253372e5eff /src/lib/protocols/http.c | |
parent | 8de62c6d34cbcd9419f82143aab39aeda0400dde (diff) |
Added malformed packet risk support
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 7d54d1470..dd6d39c88 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -594,7 +594,9 @@ static u_int16_t http_request_url_offset(struct ndpi_detection_module_struct *nd packet->payload_packet_len); /* Check first char */ - if(!packet->payload_packet_len || !strchr(http_fs,packet->payload[0])) return 0; + if(!packet->payload_packet_len || !strchr(http_fs,packet->payload[0])) + return 0; + /** FIRST PAYLOAD PACKET FROM CLIENT **/ @@ -1011,9 +1013,10 @@ static void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struc ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow) { - if(!flow) + if(!flow) { + NDPI_SET_BIT(flow->risk, NDPI_MALFORMED_PACKET); return(NDPI_HTTP_METHOD_UNKNOWN); - else + } else return(flow->http.method); } |