Bug 1500 - [Patch] clutter_text crash with non one-byte utf8 text exceed
max_length
In clutter_text_set_text_internal(), when text length in character is greater
than max_length, and there are multi-byte character in it, then the new text
string buffer is not malloc()'ed with right length. This will cause the app to
crash with segmention fault.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
}
else
{
- gchar *n = g_malloc0 (priv->max_length + 1);
+ gchar *p = g_utf8_offset_to_pointer (text, priv->max_length);
+ gchar *n = g_malloc0 ((p - text) + 1);
g_free (priv->text);