mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
gtkcssvariableset: Fix listing IDs on big-endian machines
Previously this code assumed that if we have an int stored in a hash table via GINT_TO_POINTER, we can retrieve the pointer value and treat its first sizeof(int) bytes as an item to append to a GArray of int. However, on a 64-bit big-endian system, the first sizeof(int) bytes of the pointer will be zero, which is not a valid ID for a GtkCssCustomPropertyPool, causing an out-of-bounds array access and a crash. This was visible in the `gtk:css / style` automated test. Bug-Debian: https://bugs.debian.org/1079546 Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
parent
a5df8f2f35
commit
3ef1f448a3
@ -309,7 +309,10 @@ gtk_css_variable_set_list_ids (GtkCssVariableSet *self)
|
||||
g_hash_table_iter_init (&iter, all_ids);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, &id, NULL))
|
||||
g_array_append_val (ret, id);
|
||||
{
|
||||
int value = GPOINTER_TO_INT (id);
|
||||
g_array_append_val (ret, value);
|
||||
}
|
||||
|
||||
g_hash_table_unref (all_ids);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user