1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

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

fix out of bounds read in compress_colors

See merge request irssi/irssi!18
This commit is contained in:
Nei 2017-10-20 13:10:39 +00:00 committed by ailin-nemui
commit e37d9b2497

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, '%');
}
}