compositor: Fix memory corruption 47/297047/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 9 Aug 2023 09:40:11 +0000 (18:40 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 9 Aug 2023 10:16:33 +0000 (19:16 +0900)
Calling wl_list_remove(sub->parent_surface_destroy.link) in
_e_subsurface_destroy() caused memory corruption, if it is called after
the destruction of parent surface.

Change-Id: Ifb0ee675554d13c93aed2e2c438c8a43f2d347e1

src/bin/e_compositor.c

index c2c6cc751c12af2d18163e1d399f92f488ce29bd..15ab7dc7620b98e3ccbfae8d511060b8e70adf5e 100644 (file)
@@ -1249,6 +1249,10 @@ _e_subsurface_cb_parent_surface_destroy(struct wl_listener *listener, void *data
    E_Client *ec;
 
    sub = wl_container_of(listener, sub, parent_surface_destroy);
+
+   wl_list_remove(&sub->parent_surface_destroy.link);
+   wl_list_init(&sub->parent_surface_destroy.link);
+
    e_comp_wl_client_subsurface_parent_unset(sub->surface->ec);
 
    ec = sub->surface->ec;