Re: [PATCH weston] libweston-desktop/xdg-shell-v6: Fix crash when surface has buffer at creation
On 2018-03-13 01:18 PM, Quentin Glidic wrote: On 3/13/18 5:34 PM, Derek Foreman wrote: When a surface has a buffer at creation time we send an error, which results in a disconnection and all resources being destroyed. Since we send that error and return before performing the configure_list init weston_desktop_xdg_surface_destroy() will walk an uninitialized list and dereference a NULL pointer. Initializing the list earlier prevents this from happening. Signed-off-by: Derek ForemanGood catch: Reviewed-by: Quentin Glidic And pushed. Thanks, Derek Thanks, --- libweston-desktop/xdg-shell-v6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index f9902ff0..8fa01a32 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -1370,6 +1370,7 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, surface->desktop = weston_desktop_client_get_desktop(client); surface->surface = wsurface; + wl_list_init(>configure_list); surface->desktop_surface = weston_desktop_surface_create(surface->desktop, client, @@ -1395,8 +1396,6 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, "xdg_surface must not have a buffer at creation"); return; } - - wl_list_init(>configure_list); } static void ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] libweston-desktop/xdg-shell-v6: Fix crash when surface has buffer at creation
On 3/13/18 5:34 PM, Derek Foreman wrote: When a surface has a buffer at creation time we send an error, which results in a disconnection and all resources being destroyed. Since we send that error and return before performing the configure_list init weston_desktop_xdg_surface_destroy() will walk an uninitialized list and dereference a NULL pointer. Initializing the list earlier prevents this from happening. Signed-off-by: Derek ForemanGood catch: Reviewed-by: Quentin Glidic Thanks, --- libweston-desktop/xdg-shell-v6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index f9902ff0..8fa01a32 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -1370,6 +1370,7 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, surface->desktop = weston_desktop_client_get_desktop(client); surface->surface = wsurface; + wl_list_init(>configure_list); surface->desktop_surface = weston_desktop_surface_create(surface->desktop, client, @@ -1395,8 +1396,6 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, "xdg_surface must not have a buffer at creation"); return; } - - wl_list_init(>configure_list); } static void -- Quentin “Sardem FF7” Glidic ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston] libweston-desktop/xdg-shell-v6: Fix crash when surface has buffer at creation
When a surface has a buffer at creation time we send an error, which results in a disconnection and all resources being destroyed. Since we send that error and return before performing the configure_list init weston_desktop_xdg_surface_destroy() will walk an uninitialized list and dereference a NULL pointer. Initializing the list earlier prevents this from happening. Signed-off-by: Derek Foreman--- libweston-desktop/xdg-shell-v6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index f9902ff0..8fa01a32 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -1370,6 +1370,7 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, surface->desktop = weston_desktop_client_get_desktop(client); surface->surface = wsurface; + wl_list_init(>configure_list); surface->desktop_surface = weston_desktop_surface_create(surface->desktop, client, @@ -1395,8 +1396,6 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client, "xdg_surface must not have a buffer at creation"); return; } - - wl_list_init(>configure_list); } static void -- 2.14.3 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel