state: avoid walking off empty list
When removing the last key in a list, the last part of the for statement could cause dereferencing (NULL)->next and thus segfaulting.
This commit is contained in:
parent
35c6179a8e
commit
351b6c0543
@ -273,7 +273,7 @@ clutter_state_remove_key_internal (ClutterState *this,
|
||||
{
|
||||
GList *k;
|
||||
|
||||
for (k = target_state->keys; k; k = k->next)
|
||||
for (k = target_state->keys; k != NULL; k = k?k->next:NULL)
|
||||
{
|
||||
ClutterStateKey *key = k->data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user