aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-01-24 21:04:27 +0100
committerLuca Deri <deri@ntop.org>2020-01-24 21:04:27 +0100
commitd86d632fe63114792a1fa150f8290e12bfa8f71d (patch)
treea4d95e0143785f970c20cd1a9fd36ace469f1bcd /src
parent87d228f78e6d6515fe080e818881f2bc5adf044c (diff)
Added memory boundary check in HTTP dissector
Diffstat (limited to 'src')
-rw-r--r--src/lib/protocols/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 14be88246..00522cfb9 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -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;