xwayland: verify new xsurf is valid in prop reads

fixes #6250
This commit is contained in:
Vaxry 2024-05-29 09:34:18 +02:00
parent ebf258788e
commit a60c7283e6

View file

@ -210,7 +210,7 @@ void CXWM::readProp(SP<CXWaylandSurface> XSURF, uint32_t atom, xcb_get_property_
const auto XID = (xcb_window_t*)xcb_get_property_value(reply); const auto XID = (xcb_window_t*)xcb_get_property_value(reply);
XSURF->transient = XID; XSURF->transient = XID;
if (XID) { if (XID) {
if (const auto NEWXSURF = windowForXID(*XID); !lookupParentExists(XSURF, NEWXSURF)) { if (const auto NEWXSURF = windowForXID(*XID); NEWXSURF && !lookupParentExists(XSURF, NEWXSURF)) {
XSURF->parent = NEWXSURF; XSURF->parent = NEWXSURF;
NEWXSURF->children.push_back(XSURF); NEWXSURF->children.push_back(XSURF);
} else } else