aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-05-16 00:10:35 +0200
committerLuca Deri <deri@ntop.org>2020-05-16 00:10:35 +0200
commit3d9285f1be84db7ecec821b75f67964dc4773a65 (patch)
treee88b21c20d28baaea0b371849242d5c4648eb3a9 /src/lib/protocols
parentc375782b96faf30558b3f91a7fe05eae62fc79c2 (diff)
Added check for invalid HTTP URLs
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/http.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index b648bf754..abd422007 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -266,7 +266,7 @@ static void ndpi_check_numeric_ip(struct ndpi_detection_module_struct *ndpi_stru
strncpy(buf, ip, ip_len);
buf[ip_len] = '\0';
- ip_addr.s_addr = inet_addr(buf);;
+ ip_addr.s_addr = inet_addr(buf);
if(strcmp(inet_ntoa(ip_addr), buf) == 0) {
NDPI_SET_BIT(flow->risk, NDPI_HTTP_NUMERIC_IP_HOST);
}
@@ -274,6 +274,14 @@ static void ndpi_check_numeric_ip(struct ndpi_detection_module_struct *ndpi_stru
/* ************************************************************* */
+static void ndpi_check_http_url(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ char *url) {
+
+}
+
+/* ************************************************************* */
+
/**
NOTE
ndpi_parse_packet_line_info is in ndpi_main.c
@@ -302,6 +310,8 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
strncpy(&flow->http.url[packet->host_line.len], (char*)packet->http_url_name.ptr,
packet->http_url_name.len);
flow->http.url[len-1] = '\0';
+
+ ndpi_check_http_url(ndpi_struct, flow, &flow->http.url[packet->host_line.len]);
}
if(flow->packet.http_method.len < 3)