mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
impl-client: fix crash when updating permissions
After ensure_permissions, the default permission might be moved to a different memory location. Get the new default permission in case it moved.
This commit is contained in:
parent
5240850bc1
commit
0e91233569
1 changed files with 3 additions and 1 deletions
|
|
@ -690,8 +690,10 @@ int pw_impl_client_update_permissions(struct pw_impl_client *client,
|
||||||
p = ensure_permissions(client, permissions[i].id);
|
p = ensure_permissions(client, permissions[i].id);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
pw_log_warn(NAME" %p: can't ensure permission: %m", client);
|
pw_log_warn(NAME" %p: can't ensure permission: %m", client);
|
||||||
continue;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
if ((def = find_permission(client, PW_ID_ANY)) == NULL)
|
||||||
|
return -EIO;
|
||||||
old_perm = p->permissions == PW_PERM_INVALID ? def->permissions : p->permissions;
|
old_perm = p->permissions == PW_PERM_INVALID ? def->permissions : p->permissions;
|
||||||
new_perm = permissions[i].permissions;
|
new_perm = permissions[i].permissions;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue