From de8e469c09df26fce2a841e7c085d593942a4ee6 Mon Sep 17 00:00:00 2001 From: Vitaly Lavrov Date: Mon, 4 Sep 2017 21:40:35 +0300 Subject: [PATCH] The bug in the function ndpi_parse_packet_line_info() was fixed. The function does not see the last line of the package. --- src/lib/ndpi_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 040c54959..ddfb0d913 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3753,7 +3753,7 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struc packet->line[packet->parsed_lines].ptr = packet->payload; packet->line[packet->parsed_lines].len = 0; - for(a = 0; a < end-1 /* This because get_u_int16_t(packet->payload, a) reads 2 bytes */; a++) { + for(a = 0; a <= end-1 /* This because get_u_int16_t(packet->payload, a) reads 2 bytes */; a++) { if(get_u_int16_t(packet->payload, a) == ntohs(0x0d0a)) { packet->line[packet->parsed_lines].len = (u_int16_t)(((unsigned long) &packet->payload[a]) - ((unsigned long) packet->line[packet->parsed_lines].ptr));