From eb0f441a6e3f5542d793699ba465a6fc72cc1ee0 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Wed, 12 Dec 2018 11:52:05 +0900 Subject: [PATCH] e_comp_wl: Added defensive code to check whether comp_data is NULL. There seems the case that some client doesn't have comp_data such as launchscreen and client got to know this resource id for some reason. To prevent from crashing enlightenment, this patch added check code. Change-Id: I0952afe731557b950bd6f4fc3d5321ea9844e424 --- src/bin/e_comp_wl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index c3693a5..70df05c 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -3946,7 +3946,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ } // reparent remote surface provider's subsurfaces - if (epc->comp_data->remote_surface.onscreen_parent) + if ((epc->comp_data) && (epc->comp_data->remote_surface.onscreen_parent)) { offscreen_parent = epc; epc = epc->comp_data->remote_surface.onscreen_parent; @@ -3967,7 +3967,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ return EINA_FALSE; } - if (parent->comp_data->sub.data) + if ((parent->comp_data) && (parent->comp_data->sub.data)) parent = parent->comp_data->sub.data->parent; else break; -- 2.7.4