Adds different checks against overflows

This commit is contained in:
Philippe Antoine
2020-03-19 16:54:31 +01:00
parent e9195589d2
commit c6acf97bfb
4 changed files with 7 additions and 2 deletions
+3
View File
@@ -76,6 +76,9 @@ u_int8_t check_ymsg(const u_int8_t * payload, u_int16_t payload_packet_len)
if(ylen >= payload_packet_len || yahoo_len_parsed >= payload_packet_len)
break;
if (payload_packet_len < yahoo_len_parsed + sizeof(struct ndpi_yahoo_header)) {
return 0;
}
yahoo = (struct ndpi_yahoo_header *) (payload + yahoo_len_parsed);
}
while(memcmp(yahoo->YMSG_str, "YMSG", 4) == 0);