irc: fix heap-buffer-overflow (#1765)

This commit is contained in:
Ivan Nardi
2022-10-06 09:25:21 +00:00
committed by GitHub
parent 3c0021d603
commit c4fb2a590e
+1 -1
View File
@@ -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';