[PATCH weston 04/10] desktop-shell: fix invalid memory access when shell execution fails

rawoul at gmail.com rawoul at gmail.com
Mon Aug 25 11:56:46 PDT 2014


From: Arnaud Vrac <avrac at freebox.fr>

In this case wl_client_add_destroy_listener() was called with a NULL
client, which is invalid.
---
 desktop-shell/shell.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 99f3343..a023281 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -5342,8 +5342,10 @@ launch_desktop_shell_process(void *data)
 						 shell->client,
 						 desktop_shell_sigchld);
 
-	if (!shell->child.client)
+	if (!shell->child.client) {
 		weston_log("not able to start %s\n", shell->client);
+		return;
+	}
 
 	shell->child.client_destroy_listener.notify =
 		desktop_shell_client_destroy;
-- 
1.9.1



More information about the wayland-devel mailing list