1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 10:43:13 +02:00

Fix possible crash in set::part-instead-of-quit-on-comment-change.

This commit is contained in:
Bram Matthys
2021-11-06 13:27:45 +01:00
parent c35174db32
commit 700c579ee7
+8 -3
View File
@@ -130,12 +130,17 @@ CMD_FUNC(cmd_quit)
char tmp[512];
int ret;
strlcpy(tmp, newcomment, sizeof(tmp));
parx[0] = NULL;
parx[1] = channel->name;
parx[2] = tmp;
parx[3] = NULL;
if (newcomment)
{
strlcpy(tmp, newcomment, sizeof(tmp));
parx[2] = tmp;
parx[3] = NULL;
} else {
parx[2] = NULL;
}
do_cmd(client, recv_mtags, "PART", newcomment ? 3 : 2, parx);
/* This would be unusual, but possible (somewhere in the future perhaps): */