Added improved boundary check

This commit is contained in:
Luca Deri
2020-06-14 09:29:52 +02:00
parent 4247dd8322
commit 38e4910636
+1 -1
View File
@@ -4870,7 +4870,7 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str,
if((packet->payload[a] == 0x0d) && (packet->payload[a+1] == 0x0a)) {
/* If end of line char sequence CR+NL "\r\n", process line */
if(((a + 3) <= packet->payload_packet_len)
if(((a + 3) < packet->payload_packet_len)
&& (packet->payload[a+2] == 0x0d)
&& (packet->payload[a+3] == 0x0a)) {
/* \r\n\r\n */