Merge branch 'fix-gl-15' into 'security'

Don't proceed with cmd_msg if there was an error splitting msg

See merge request irssi/irssi!21
This commit is contained in:
Nei 2017-10-20 13:16:27 +00:00 committed by ailin-nemui
commit c46bed1e17
2 changed files with 10 additions and 2 deletions

View file

@ -116,11 +116,14 @@ static char **split_line(const SERVER_REC *server, const char *line,
* the code much simpler. It's worth it.
*/
len -= strlen(recoded_start) + strlen(recoded_end);
g_warn_if_fail(len > 0);
if (len <= 0) {
/* There is no room for anything. */
g_free(recoded_start);
g_free(recoded_end);
return NULL;
lines = g_new(char *, 1);
lines[0] = NULL;
return lines;
}
lines = recode_split(server, line, target, len, onspace);