mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-29 08:56:15 +01:00
Merge branch 'wip/carlosg/utf8-strreverse-invalid-writes' into 'master'
gutf8: Assert that written memory stays in bounds See merge request GNOME/glib!1026
This commit is contained in:
commit
6d7143e91d
@ -1773,6 +1773,7 @@ g_utf8_strreverse (const gchar *str,
|
|||||||
{
|
{
|
||||||
gchar *m, skip = g_utf8_skip[*(guchar*) p];
|
gchar *m, skip = g_utf8_skip[*(guchar*) p];
|
||||||
r -= skip;
|
r -= skip;
|
||||||
|
g_assert (r >= result);
|
||||||
for (m = r; skip; skip--)
|
for (m = r; skip; skip--)
|
||||||
*m++ = *p++;
|
*m++ = *p++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user