aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorshua <itis@isthisa.email>2022-11-09 01:01:50 -0500
committerGitHub <noreply@github.com>2022-11-09 00:01:50 -0600
commitf1639ba9d5c807792fe5d0628caa1faf3316ca44 (patch)
tree3800b6d010f86f0efa44c6136595cb1ce612421a /dwl.c
parent8bd344257501b9293126348bf956beb8c9ddcfae (diff)
check null in toplevel_from_popup
managed to SEGFAULT the server by trying to create a popup without setting a parent first. Not sure if this is dwl or wlroots issue, so also opened a ticket upstream: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3811
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 52bfa58..5ee3c92 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1016,6 +1016,8 @@ createnotify(struct wl_listener *listener, void *data)
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_box box;
LayerSurface *l = toplevel_from_popup(xdg_surface->popup);
+ if (!xdg_surface->popup->parent)
+ return;
xdg_surface->surface->data = wlr_scene_xdg_surface_create(
xdg_surface->popup->parent->data, xdg_surface);
/* Probably the check of `l` is useless, the only thing that can be NULL