wayland/transaction: Check surface pointer validity in _ensure_entry
If a caller passes in NULL or a non-NULL value which doesn't point to a valid MetaWaylandSurface object, this will hopefully point in the direction of the cause. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3725>
This commit is contained in:
parent
b67f94ca7e
commit
dd32f3b3be
1 changed files with 5 additions and 1 deletions
|
@ -485,8 +485,12 @@ meta_wayland_transaction_ensure_entry (MetaWaylandTransaction *transaction,
|
|||
if (entry)
|
||||
return entry;
|
||||
|
||||
g_return_val_if_fail (surface, NULL);
|
||||
surface = g_object_ref (surface);
|
||||
g_return_val_if_fail (surface, NULL);
|
||||
|
||||
entry = g_new0 (MetaWaylandTransactionEntry, 1);
|
||||
g_hash_table_insert (transaction->entries, g_object_ref (surface), entry);
|
||||
g_hash_table_insert (transaction->entries, surface, entry);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue