diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-10-25 16:16:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 16:16:24 +0200 |
commit | 550f3e5b9d9de4e662ecfbed0059cd3351e2278b (patch) | |
tree | 2b118d8f40bc481ca1f2ad39fc6e82c96383c81d /src/lib/protocols/irc.c | |
parent | e674a8ae37db3cc5a773b63d4e82b89b42ad14f2 (diff) |
IRC: fix memory access (#1787)
Diffstat (limited to 'src/lib/protocols/irc.c')
-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 9f9034641..a5da28ef1 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", packet->payload_packet_len - 5, &user[5]); + snprintf(buf, sizeof(buf), "%.*s", (int)(packet->payload_packet_len - (user + 5 - (char *)packet->payload)), user + 5); if((sp = strchr(buf, ' ')) != NULL) sp[0] = '\0'; |