Minor changes

This commit is contained in:
Luca Deri
2020-05-31 19:11:12 +02:00
parent dc5b4cbde0
commit a4f8d913ea
+5 -3
View File
@@ -108,7 +108,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo
if(ndpi_strncasestr(app, "mpeg", app_len_avail) != NULL) { if(ndpi_strncasestr(app, "mpeg", app_len_avail) != NULL) {
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING; flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING;
return(flow->category); return(flow->category);
} else if (app_len_avail > 1) { } else if(app_len_avail > 3) {
const char** cmp_mimes = NULL; const char** cmp_mimes = NULL;
switch(app[0]) { 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; case 'x': cmp_mimes = binary_file_mimes_x; break;
} }
if(cmp_mimes) { if(cmp_mimes != NULL) {
for(int i = 0; cmp_mimes[i] != NULL; i++) { u_int8_t i;
for(i = 0; cmp_mimes[i] != NULL; i++) {
if(ndpi_strncasestr(app, cmp_mimes[i], app_len_avail) != NULL) { if(ndpi_strncasestr(app, cmp_mimes[i], app_len_avail) != NULL) {
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT;
NDPI_SET_BIT(flow->risk, NDPI_BINARY_APPLICATION_TRANSFER); NDPI_SET_BIT(flow->risk, NDPI_BINARY_APPLICATION_TRANSFER);