mirror of
https://github.com/brl/mutter.git
synced 2025-03-28 22:23:47 +00:00
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;
|
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;
|
ClutterStateKey *key = k->data;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user