From 2ac6438294ba14f354dc7ec97ea75dc9309b430d Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Wed, 22 Dec 2021 19:32:28 +0900 Subject: [PATCH] shell : add null check of pepper list when using pepper_list_for_each_list Change-Id: I7ac045ff9ef92ebf3d141975931c8c6e285c7d8e (cherry picked from commit cffa344a398a246bef8945470d3ad1a59097ccc1) --- src/shell/shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shell/shell.c b/src/shell/shell.c index 3b63f79..425af90 100644 --- a/src/shell/shell.c +++ b/src/shell/shell.c @@ -1055,7 +1055,7 @@ headless_shell_cb_idle(void *data) { headless_shell_t *hs_shell = (headless_shell_t *)data; const pepper_list_t *list; - pepper_list_t *l; + pepper_list_t *l = NULL; pepper_view_t *view; pepper_surface_t *surface; headless_shell_surface_t *hs_surface; @@ -1066,6 +1066,8 @@ headless_shell_cb_idle(void *data) list = pepper_compositor_get_view_list(hs_shell->compositor); pepper_list_for_each_list(l, list) { + if (!l) break; + view = (pepper_view_t *)l->item; PEPPER_CHECK(view, continue, "[SHELL] idle_cb, Invalid object view:%p\n", view); -- 2.7.4