Added memory boundary check in HTTP dissector

This commit is contained in:
Luca Deri
2020-01-24 21:04:27 +01:00
parent 87d228f78e
commit d86d632fe6
2 changed files with 61 additions and 61 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
setHttpUserAgent(ndpi_struct, flow, token);
}
}
} else if(memcmp(ua, "netflix-ios-app", 15) == 0) {
} else if((packet->user_agent_line.len > 14) && (memcmp(ua, "netflix-ios-app", 15) == 0)) {
NDPI_LOG_INFO(ndpi_struct, "found netflix\n");
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING);
return;