From 7f885a2e94d6005cddf591b8d2d0abf176a3632f Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 23 Oct 2024 18:45:47 +0300 Subject: [PATCH] proxy: invalidate proxy id when removed from map Client-side bugs calling methods on destroyed proxies like pw_proxy_ref(p); pw_proxy_destroy(p); ... wait for server to ack the remove ... pw_core_destroy(p->core, p); /* p already removed & destroyed */ should not send messages with the stale proxy id to server. Set id to SPA_ID_INVALID when removing a proxy from the id map, so that such client bugs only result to ENOENT. --- src/pipewire/proxy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pipewire/proxy.c b/src/pipewire/proxy.c index 4b0c777dd..577f9a649 100644 --- a/src/pipewire/proxy.c +++ b/src/pipewire/proxy.c @@ -191,6 +191,9 @@ static inline void remove_from_map(struct pw_proxy *proxy) if (proxy->core) pw_map_remove(&proxy->core->objects, proxy->id); proxy->in_map = false; + + /* Make sure any future method calls fail */ + proxy->id = SPA_ID_INVALID; } }