Added memory boundary checks

This commit is contained in:
Luca Deri
2020-05-22 07:24:02 +02:00
parent 3874f0e0e0
commit bbbc5fdbae
+2 -1
View File
@@ -4858,7 +4858,8 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_str,
if(get_u_int16_t(packet->payload, a) == ntohs(0x0d0a)) {
/* If end of line char sequence CR+NL "\r\n", process line */
if(get_u_int16_t(packet->payload, a+2) == ntohs(0x0d0a)) {
if(((a + 3) <= packet->payload_packet_len)
&& (get_u_int16_t(packet->payload, a+2) == ntohs(0x0d0a))) {
/* \r\n\r\n */
int diff; /* No unsigned ! */
u_int32_t a1 = a + 4;