fixed server-side pm buffer overflow
This commit is contained in:
parent
17f1329325
commit
972619bafa
@ -739,7 +739,7 @@ void *why2_communicate_thread(void *arg)
|
|||||||
connection_node_t pm_connection_node = *(connection_node_t*) pm_connection -> value;
|
connection_node_t pm_connection_node = *(connection_node_t*) pm_connection -> value;
|
||||||
|
|
||||||
//ALLOCATE MESSAGE TO SEND TO RECEIVER
|
//ALLOCATE MESSAGE TO SEND TO RECEIVER
|
||||||
char *private_msg = why2_malloc(strlen(WHY2_CHAT_CODE_PM_SERVER) + strlen(node.username) + strlen(pm_connection_node.username) + strlen(msg) + 5);
|
char *private_msg = why2_malloc(strlen(WHY2_CHAT_CODE_PM_SERVER) + strlen(node.username) + strlen(pm_connection_node.username) + strlen(msg) + 6);
|
||||||
|
|
||||||
//CONSTRUCT DA MESSAGE
|
//CONSTRUCT DA MESSAGE
|
||||||
sprintf(private_msg, WHY2_CHAT_CODE_PM_SERVER ";%s;%s;%s;%c", node.username, pm_connection_node.username, msg, '\0');
|
sprintf(private_msg, WHY2_CHAT_CODE_PM_SERVER ";%s;%s;%s;%c", node.username, pm_connection_node.username, msg, '\0');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user