libweston-desktop/xdg-shell-v6: Fix crash when surface has buffer at creation
authorDerek Foreman <derekf@osg.samsung.com>
Tue, 13 Mar 2018 16:34:47 +0000 (11:34 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 15 Mar 2018 00:02:48 +0000 (19:02 -0500)
commitd1510b4f40aad09372e9721d91d7df41fdaece71
tree9232cf03180d5beadaad0b3b4cd917664e1431d9
parent64a26bc192b7125b23c95725804ced0e0180b4e3
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 <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
libweston-desktop/xdg-shell-v6.c