mirror of
https://github.com/hyprwm/hyprwayland-scanner.git
synced 2024-11-26 12:05:58 +01:00
core: avoid uaf in resource_set_user_data
This commit is contained in:
parent
f5181a068c
commit
3afed43647
1 changed files with 2 additions and 1 deletions
|
@ -723,11 +723,12 @@ const wl_interface {} = {{
|
||||||
wl_list_remove(&resourceDestroyListener.link);
|
wl_list_remove(&resourceDestroyListener.link);
|
||||||
wl_list_init(&resourceDestroyListener.link);
|
wl_list_init(&resourceDestroyListener.link);
|
||||||
|
|
||||||
|
wl_resource_set_user_data(pResource, nullptr);
|
||||||
|
|
||||||
// if we still own the wayland resource,
|
// if we still own the wayland resource,
|
||||||
// it means we need to destroy it.
|
// it means we need to destroy it.
|
||||||
if (wl_resource_get_user_data(pResource) == this)
|
if (wl_resource_get_user_data(pResource) == this)
|
||||||
wl_resource_destroy(pResource);
|
wl_resource_destroy(pResource);
|
||||||
wl_resource_set_user_data(pResource, nullptr);
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
void {}::onDestroyCalled() {{
|
void {}::onDestroyCalled() {{
|
||||||
|
|
Loading…
Reference in a new issue