Merge branch 'security' into 'master'

Security

Closes GL#12, GL#13, GL#14, GL#15, GL#16

See merge request irssi/irssi!23

(cherry picked from commit 0557a2cb7c)
This commit is contained in:
Nei 2017-10-20 13:31:26 +00:00 committed by ailin-nemui
commit 29f0ed96d5
8 changed files with 67 additions and 9 deletions

View file

@ -587,7 +587,7 @@ static char *theme_format_compress_colors(THEME_REC *theme, const char *format)
/* a normal character */
g_string_append_c(str, *format);
format++;
} else {
} else if (format[1] != '\0') {
/* %format */
format++;
if (IS_OLD_FORMAT(*format, last_fg, last_bg)) {
@ -614,6 +614,11 @@ static char *theme_format_compress_colors(THEME_REC *theme, const char *format)
last_bg = '\0';
}
format++;
} else {
/* % at end of string */
format++;
g_string_append_c(str, '%');
g_string_append_c(str, '%');
}
}