From ee2c357ec29815d359d3c62264b5c7b36f9b3301 Mon Sep 17 00:00:00 2001 From: Chengyu Zheng Date: Mon, 10 Sep 2018 11:54:23 +0200 Subject: [PATCH] tree/container: fix null pointer dereferencing --- sway/tree/container.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/tree/container.c b/sway/tree/container.c index ccd79f0e7..d9be5ec52 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -303,6 +303,9 @@ static struct sway_container *floating_container_at(double lx, double ly, struct sway_container *tiling_container_at(struct sway_node *parent, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { + if (parent == NULL) { + return NULL; + } if (node_is_view(parent)) { surface_at_view(parent->sway_container, lx, ly, surface, sx, sy); return parent->sway_container;