Add check for large compose files

Fixes #4990
This commit is contained in:
Luca Bacci 2023-07-19 16:19:28 +02:00
parent 6dd9048c6d
commit add197bcf7

View File

@ -980,6 +980,7 @@ parser_get_compose_table (GtkComposeParser *parser)
current_first = (guint16)sequence[0];
data[first_pos] = (guint16)sequence[0];
for (i = 1; i < index_rowstride; i++)
data[first_pos + i] = rest_pos;
}
@ -998,6 +999,14 @@ parser_get_compose_table (GtkComposeParser *parser)
rest_pos += len;
if (rest_pos >= 0x8000)
{
g_warning ("GTK can't handle compose tables this large (%s)", parser->compose_file ? parser->compose_file : "");
g_free (data);
g_string_free (char_data, TRUE);
return NULL;
}
for (i = len + 1; i < index_rowstride; i++)
data[first_pos + i] = rest_pos;