mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-27 10:14:14 +00:00
Fix undefined behaviour in xytonode
Sometimes pnode->parent is NULL.
This commit is contained in:
parent
c1d8b77f7f
commit
36bbf8affc
5
dwl.c
5
dwl.c
@ -2638,8 +2638,11 @@ xytonode(double x, double y, struct wlr_surface **psurface,
|
|||||||
surface = wlr_scene_surface_from_buffer(
|
surface = wlr_scene_surface_from_buffer(
|
||||||
wlr_scene_buffer_from_node(node))->surface;
|
wlr_scene_buffer_from_node(node))->surface;
|
||||||
/* Walk the tree to find a node that knows the client */
|
/* Walk the tree to find a node that knows the client */
|
||||||
for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
|
for (pnode = node; pnode && !c; pnode = &pnode->parent->node) {
|
||||||
c = pnode->data;
|
c = pnode->data;
|
||||||
|
if (!pnode->parent)
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (c && c->type == LayerShell) {
|
if (c && c->type == LayerShell) {
|
||||||
c = NULL;
|
c = NULL;
|
||||||
l = pnode->data;
|
l = pnode->data;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user