diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-10-06 11:25:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 09:25:21 +0000 |
commit | c4fb2a590e2648ee52641b3afe22157d2e9173d3 (patch) | |
tree | ad04aee158b13b5cc3dc11be25ab573346d15eda /src/lib/protocols | |
parent | 3c0021d6036532a6fdff9196b7ee7a614bdbd525 (diff) |
irc: fix heap-buffer-overflow (#1765)
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/irc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c index 367ec86bd..9f9034641 100644 --- a/src/lib/protocols/irc.c +++ b/src/lib/protocols/irc.c @@ -408,7 +408,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc if(user) { char buf[32], msg[64], *sp; - snprintf(buf, sizeof(buf), "%s", &user[5]); + snprintf(buf, sizeof(buf), "%.*s", packet->payload_packet_len - 5, &user[5]); if((sp = strchr(buf, ' ')) != NULL) sp[0] = '\0'; |