aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2022-06-02 13:07:09 +0200
committerGitHub <noreply@github.com>2022-06-02 13:07:09 +0200
commit6149c0f880163b0bebd513fa957ece325c77cb88 (patch)
tree2010c02635b85d462299e02789b9552333048a1e
parent4ff1bf29dfbfa860bb79e34536de7090cc009ddc (diff)
Fix heap buffer overflow mentioned in #1574. (#1576)
Signed-off-by: lns <matzeton@googlemail.com>
-rw-r--r--src/lib/protocols/irc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c
index 33c41a4c3..80de27417 100644
--- a/src/lib/protocols/irc.c
+++ b/src/lib/protocols/irc.c
@@ -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) {