The bug in the function ndpi_parse_packet_line_info() was fixed.

The function does not see the last line of the package.
This commit is contained in:
Vitaly Lavrov
2017-09-04 21:40:35 +03:00
parent 3cfcc05912
commit de8e469c09
+1 -1
View File
@@ -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));