From 6796c5d0232747eba2d7256f97ca7a1d0afa44ce Mon Sep 17 00:00:00 2001 From: Steve3184 <77789906+Steve3184@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:49:56 +0800 Subject: [PATCH] chore: add TODO about potential use-after-free in get_capturer_for_display() Signed-off-by: Steve3184 <77789906+Steve3184@users.noreply.github.com> --- src/server/wayland.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/wayland.rs b/src/server/wayland.rs index 607317bfc..a29ec0bca 100644 --- a/src/server/wayland.rs +++ b/src/server/wayland.rs @@ -369,6 +369,9 @@ pub(super) fn get_capturer_for_display( "get_capturer_for_display: no active capturers, reinitializing PipeWire session for display {}.", display_idx ); + + // to-do: Potential use-after-free: clone() aliases raw pointer and clear() frees it. + // Requires ownership refactor to make lifetime sound. clear(); ensure_inited()?;