mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 07:32:04 +02:00
Don't proceed with cmd_msg if there was an error splitting msg
There may be cases (such as if target or server->nick is very long) where the split_message function returns NULL, indicating an error. To avoid a potential segfault, we now check to see if splitmsgs is NULL.
This commit is contained in:
parent
28d0b8c746
commit
73d7b9d775
1 changed files with 4 additions and 1 deletions
|
|
@ -404,7 +404,10 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
||||||
else
|
else
|
||||||
splitmsgs = singlemsg;
|
splitmsgs = singlemsg;
|
||||||
|
|
||||||
while ((m = splitmsgs[n++])) {
|
/* splitmsgs may be NULL if there was an error */
|
||||||
|
g_warn_if_fail(splitmsgs != NULL);
|
||||||
|
|
||||||
|
while (splitmsgs && (m = splitmsgs[n++])) {
|
||||||
signal_emit("server sendmsg", 4, server, target, m,
|
signal_emit("server sendmsg", 4, server, target, m,
|
||||||
GINT_TO_POINTER(target_type));
|
GINT_TO_POINTER(target_type));
|
||||||
signal_emit(target_type == SEND_TARGET_CHANNEL ?
|
signal_emit(target_type == SEND_TARGET_CHANNEL ?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue