From 3bce5dfc9f288ffcfa045ae0a80bcc015d0966c5 Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 21 Apr 2018 19:04:48 +0100 Subject: Fix segfaults in wlr_surface_is_* --- xwayland/xwm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xwayland') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 77dc0797..599006ae 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -80,7 +80,8 @@ const char *atom_map[ATOM_LAST] = { const char *wlr_xwayland_surface_role = "wlr_xwayland_surface"; bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface) { - return strcmp(surface->role, wlr_xwayland_surface_role) == 0; + return surface->role != NULL && + strcmp(surface->role, wlr_xwayland_surface_role) == 0; } struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface( -- cgit v1.2.3