mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
guniprop.c: Avoid creating (temporarily) out-of-bounds pointers
This is detected by UBSan on CHERI systems (e.g. Arm Morello) and could result in non-derefenceable pointers when compiled without optimizations.
This commit is contained in:
parent
cfab7d1d48
commit
ed6cc1ddb2
@ -573,7 +573,7 @@ g_unichar_toupper (gunichar c)
|
||||
gunichar val = ATTTABLE (c >> 8, c & 0xff);
|
||||
if (val >= 0x1000000)
|
||||
{
|
||||
const gchar *p = special_case_table + val - 0x1000000;
|
||||
const gchar *p = special_case_table + (val - 0x1000000);
|
||||
val = g_utf8_get_char (p);
|
||||
}
|
||||
/* Some lowercase letters, e.g., U+000AA, FEMININE ORDINAL INDICATOR,
|
||||
@ -613,8 +613,8 @@ g_unichar_tolower (gunichar c)
|
||||
gunichar val = ATTTABLE (c >> 8, c & 0xff);
|
||||
if (val >= 0x1000000)
|
||||
{
|
||||
const gchar *p = special_case_table + val - 0x1000000;
|
||||
return g_utf8_get_char (p);
|
||||
const gchar *p = special_case_table + (val - 0x1000000);
|
||||
return g_utf8_get_char (p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user