From e45237a93f771f3d4aeb6c2360469f09c0282b58 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 1 Oct 2019 12:25:39 +0200 Subject: Removed http:// from HTTP url Reported URL in ndpiReader --- src/lib/protocols/http.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index a118477c5..cc27b8eb6 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -162,13 +162,12 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ if((flow->http.url == NULL) && (packet->http_url_name.len > 0) && (packet->host_line.len > 0)) { - int len = packet->http_url_name.len + packet->host_line.len + 7 + 1; /* "http://" */ + int len = packet->http_url_name.len + packet->host_line.len + 1; flow->http.url = ndpi_malloc(len); if(flow->http.url) { - strcpy(flow->http.url, "http://"); - strncpy(&flow->http.url[7], (char*)packet->host_line.ptr, packet->host_line.len); - strncpy(&flow->http.url[7+packet->host_line.len], (char*)packet->http_url_name.ptr, + strncpy(flow->http.url, (char*)packet->host_line.ptr, packet->host_line.len); + 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'; } -- cgit v1.2.3