diff options
author | lucaderi <deri@ntop.org> | 2016-09-27 08:01:15 +0200 |
---|---|---|
committer | lucaderi <deri@ntop.org> | 2016-09-27 08:01:15 +0200 |
commit | 67ac0b431c3bb812829db4a927a309a089bca13e (patch) | |
tree | 58fd3a2d5b0973302ef0ba05de7bfa5793eee56d /src/lib/ndpi_main.c | |
parent | 1f807a1348c4f831a2b9ba1cc8b70f20c978df3f (diff) |
Fix for #249 (not sure is enough)
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index c07920ae1..c9ead2f61 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3711,7 +3711,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; 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)); @@ -3764,10 +3764,8 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struc } if(packet->line[packet->parsed_lines].len > 14 - && - (memcmp - (packet->line[packet->parsed_lines].ptr, "Content-Type: ", - 14) == 0 || memcmp(packet->line[packet->parsed_lines].ptr, "Content-type: ", 14) == 0)) { + && (memcmp(packet->line[packet->parsed_lines].ptr, "Content-Type: ", 14) == 0 + || memcmp(packet->line[packet->parsed_lines].ptr, "Content-type: ", 14) == 0)) { packet->content_line.ptr = &packet->line[packet->parsed_lines].ptr[14]; packet->content_line.len = packet->line[packet->parsed_lines].len - 14; } @@ -3845,7 +3843,6 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struc packet->line[packet->parsed_lines].len = 0; if((a + 2) >= packet->payload_packet_len) { - return; } a++; |