Skip to content
Permalink
Browse files Browse the repository at this point in the history
irc: fix crash when receiving a malformed message 324 (channel mode)
Thanks to Stuart Nevans Locke for reporting the issue.
  • Loading branch information
flashcode committed Feb 8, 2020
1 parent 39f2591 commit 6f4f147
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog.adoc
Expand Up @@ -30,6 +30,7 @@ Bug fixes::

* core: flush stdout/stderr before forking in hook_process function (issue #1441)
* core: fix evaluation of condition with nested "if" (issue #1434)
* irc: fix crash when receiving a malformed message 324 (channel mode)
* irc: add nick changes in the hotlist (except self nick change)
* irc: case-insensitive comparison on incoming CTCP command, force upper case on CTCP replies (issue #1439)
* irc: fix memory leak when the channel topic is changed
Expand Down
21 changes: 12 additions & 9 deletions src/plugins/irc/irc-mode.c
Expand Up @@ -224,17 +224,20 @@ irc_mode_channel_update (struct t_irc_server *server,
current_arg++;
if (pos[0] == chanmode)
{
chanmode_found = 1;
if (set_flag == '+')
if (!chanmode_found)
{
str_mode[0] = pos[0];
str_mode[1] = '\0';
strcat (new_modes, str_mode);
if (argument)
chanmode_found = 1;
if (set_flag == '+')
{
if (new_args[0])
strcat (new_args, " ");
strcat (new_args, argument);
str_mode[0] = pos[0];
str_mode[1] = '\0';
strcat (new_modes, str_mode);
if (argument)
{
if (new_args[0])
strcat (new_args, " ");
strcat (new_args, argument);
}
}
}
}
Expand Down

0 comments on commit 6f4f147

Please sign in to comment.