Bittorrent: fix a potential use-of-uninitialized-value error (#1296)

Not sure if this is the right fix (from a logical point-of-view): this
code hasn't changed since OpenDPI era (!) and I have't found a trace
triggering this code path.
Anyway, the use-of-uninitialized-value error itself should be fixed.
This commit is contained in:
Ivan Nardi
2021-09-13 18:24:42 +02:00
committed by GitHub
parent 22241a1d36
commit 17774bf09c
+1 -1
View File
@@ -163,7 +163,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
}
/* this is a self built client, not possible to catch asymmetrically */
if((packet->parsed_lines == 10 || (packet->parsed_lines == 11 && packet->line[11].len == 0))
if((packet->parsed_lines == 10 || (packet->parsed_lines == 11 && packet->line[10].len == 0))
&& packet->user_agent_line.ptr != NULL
&& packet->user_agent_line.len > 12
&& memcmp(packet->user_agent_line.ptr, "Mozilla/4.0 ",