aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-05-31 19:11:12 +0200
committerLuca Deri <deri@ntop.org>2020-05-31 19:11:12 +0200
commita4f8d913eae021079b46949a9e444105167afe4f (patch)
treeb882d49d0ce728e5033973eb22cdc318f93d1f8f /src
parentdc5b4cbde0b7988ae562cbe2c36f5286554b3a61 (diff)
Minor changes
Diffstat (limited to 'src')
-rw-r--r--src/lib/protocols/http.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index bd8ee5672..7db270212 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -102,13 +102,13 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo
u_int app_len = sizeof("application");
if(packet->content_line.len > app_len) {
- const char *app = (const char *)&packet->content_line.ptr[app_len];
- u_int app_len_avail = packet->content_line.len-app_len;
+ const char *app = (const char *)&packet->content_line.ptr[app_len];
+ u_int app_len_avail = packet->content_line.len-app_len;
if(ndpi_strncasestr(app, "mpeg", app_len_avail) != NULL) {
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING;
return(flow->category);
- } else if (app_len_avail > 1) {
+ } else if(app_len_avail > 3) {
const char** cmp_mimes = NULL;
switch(app[0]) {
@@ -117,8 +117,10 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo
case 'x': cmp_mimes = binary_file_mimes_x; break;
}
- if(cmp_mimes) {
- for(int i = 0; cmp_mimes[i] != NULL; i++) {
+ if(cmp_mimes != NULL) {
+ u_int8_t i;
+
+ for(i = 0; cmp_mimes[i] != NULL; i++) {
if(ndpi_strncasestr(app, cmp_mimes[i], app_len_avail) != NULL) {
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT;
NDPI_SET_BIT(flow->risk, NDPI_BINARY_APPLICATION_TRANSFER);