IRC: fix memory access (#1787)
This commit is contained in:
@@ -408,7 +408,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
if(user) {
|
if(user) {
|
||||||
char buf[32], msg[64], *sp;
|
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)
|
if((sp = strchr(buf, ' ')) != NULL)
|
||||||
sp[0] = '\0';
|
sp[0] = '\0';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user