aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-21 19:04:48 +0100
committeremersion <contact@emersion.fr>2018-04-21 19:04:48 +0100
commit3bce5dfc9f288ffcfa045ae0a80bcc015d0966c5 (patch)
treeb2604a62dfa28c85dd09755346371c23b17c5a0a /xwayland
parentbfcd3f3707e8bb628db7ea8ccb4a642a557f8f97 (diff)
Fix segfaults in wlr_surface_is_*
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c3
1 files changed, 2 insertions, 1 deletions
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(