mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
client: warn for invalid global ids
This commit is contained in:
parent
d5643e8472
commit
e42fd9301b
1 changed files with 6 additions and 2 deletions
|
|
@ -425,15 +425,19 @@ void pw_client_update_permissions(struct pw_client *client, const struct spa_dic
|
||||||
}
|
}
|
||||||
else if (strcmp(dict->items[i].key, PW_CORE_PROXY_PERMISSIONS_GLOBAL) == 0) {
|
else if (strcmp(dict->items[i].key, PW_CORE_PROXY_PERMISSIONS_GLOBAL) == 0) {
|
||||||
struct pw_global *global;
|
struct pw_global *global;
|
||||||
|
uint32_t global_id;
|
||||||
|
|
||||||
/* permissions.update=<global-id>:[r][w][x] */
|
/* permissions.update=<global-id>:[r][w][x] */
|
||||||
len = strcspn(str, ":");
|
len = strcspn(str, ":");
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
global = pw_core_find_global(client->core, atoi(str));
|
global_id = atoi(str);
|
||||||
if (global == NULL)
|
global = pw_core_find_global(client->core, global_id);
|
||||||
|
if (global == NULL) {
|
||||||
|
pw_log_warn("client %p: invalid global %d", client, global_id);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
update.permissions = parse_mask(str + len);
|
update.permissions = parse_mask(str + len);
|
||||||
update.only_new = false;
|
update.only_new = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue