mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 14:58:06 +02:00
libweston/desktop: avoid weston crash while xdg_surface ack_configure
checks the resource and sends a protocol error if the client tries to
send a request to an inert object then returns out of the request
handler
Signed-off-by: Jeri Li <jeri.li@mediatek.com>
(cherry picked from commit 04f27f1be2)
This commit is contained in:
parent
8cb33a1916
commit
c520557fa5
2 changed files with 16 additions and 0 deletions
|
|
@ -1200,6 +1200,14 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client,
|
|||
{
|
||||
struct weston_desktop_surface *dsurface =
|
||||
wl_resource_get_user_data(resource);
|
||||
if (dsurface == NULL) {
|
||||
wl_resource_post_error(resource,
|
||||
ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED,
|
||||
"xdg surface already destroyed configure "
|
||||
"serial: %u", serial);
|
||||
return;
|
||||
}
|
||||
|
||||
struct weston_desktop_xdg_surface *surface =
|
||||
weston_desktop_surface_get_implementation_data(dsurface);
|
||||
struct weston_desktop_xdg_surface_configure *configure, *temp;
|
||||
|
|
|
|||
|
|
@ -1414,6 +1414,14 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client,
|
|||
{
|
||||
struct weston_desktop_surface *dsurface =
|
||||
wl_resource_get_user_data(resource);
|
||||
if (dsurface == NULL) {
|
||||
wl_resource_post_error(resource,
|
||||
XDG_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT,
|
||||
"xdg surface already destroyed configure "
|
||||
"serial: %u", serial);
|
||||
return;
|
||||
}
|
||||
|
||||
struct weston_desktop_xdg_surface *surface =
|
||||
weston_desktop_surface_get_implementation_data(dsurface);
|
||||
struct weston_desktop_xdg_surface_configure *configure, *temp;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue