Fix heap buffer overflow mentioned in #1574. (#1576)

Signed-off-by: lns <matzeton@googlemail.com>
This commit is contained in:
Toni
2022-06-02 13:07:09 +02:00
committed by GitHub
parent 4ff1bf29df
commit 6149c0f880
+1 -1
View File
@@ -517,7 +517,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
for (i = 0; i < packet->parsed_lines; i++) {
if (packet->line[i].len > 6 && memcmp(packet->line[i].ptr, "NOTICE ", 7) == 0) {
NDPI_LOG_DBG2(ndpi_struct, "NOTICE");
for (j = 7; j < packet->line[i].len - 8; j++) {
for (j = 7; j < packet->line[i].len - 9; j++) {
if (packet->line[i].ptr[j] == ':') {
if (memcmp(&packet->line[i].ptr[j + 1], "DCC SEND ", 9) == 0
|| memcmp(&packet->line[i].ptr[j + 1], "DCC CHAT ", 9) == 0) {