HTTP: fix memory access in ndpi_http_parse_subprotocol() (#1151)

This commit is contained in:
Ivan Nardi
2021-03-09 19:46:32 +01:00
committed by GitHub
parent 574fc4f09e
commit 8074bc8201
+3 -2
View File
@@ -352,8 +352,9 @@ static void ndpi_http_parse_subprotocol(struct ndpi_detection_module_struct *ndp
if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP,
(char *)flow->host_server_name,
strlen((const char *)flow->host_server_name)) == 0) {
if((strstr(flow->http.url, ":8080/downloading?n=0.") != NULL)
|| (strstr(flow->http.url, ":8080/upload?n=0.") != NULL)) {
if(flow->http.url &&
((strstr(flow->http.url, ":8080/downloading?n=0.") != NULL)
|| (strstr(flow->http.url, ":8080/upload?n=0.") != NULL))) {
/* This looks like Ookla speedtest */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_HTTP);
}