[PATCH 1/2] Fix segfault in client when demarshalling fails

Casey Dahlin cdahlin at redhat.com
Sun Jul 17 23:00:24 PDT 2011


---
 wayland/wayland-client.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/wayland/wayland-client.c b/wayland/wayland-client.c
index ce27a90..d1ed25a 100644
--- a/wayland/wayland-client.c
+++ b/wayland/wayland-client.c
@@ -521,6 +521,11 @@ handle_event(struct wl_display *display,
 	closure = wl_connection_demarshal(display->connection,
 					  size, display->objects, message);
 
+	if (! closure) {
+		fprintf(stderr, "Error demarshalling closure: %m\n");
+		return;
+	}
+
 	if (wl_debug)
 		wl_closure_print(closure, &proxy->object, false);
 
-- 
1.7.6



More information about the wayland-devel mailing list