nashaofu / xcap

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (to be implemented).

Home Page:https://docs.rs/xcap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible race condition in get_window_title

gucki opened this issue · comments

I was looking a bit into the code because I noticed the title of a window's struct is not updated. While looking at the code I saw that first the length of the window title is retrieved, then a vec of that size is created and the title loaded into it. Imo this is prone to a race condition: if the window title length changes during the calls (which is of course very unlikely in that short timeframe, but still possible). Or am I mistaken?