From 69365c7609fbbafe52387fd81f79c945b4649fa3 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:20:33 +0200 Subject: [PATCH] fix monitor rule possible segv --- src/events/Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index fa080dd7..116470c8 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -118,7 +118,7 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_iMonitorID = PMONITOR->ID; } else { const long int MONITOR = std::stoi(MONITORSTR); - if (MONITOR >= (long int)g_pCompositor->m_vMonitors.size() || MONITOR < (long int)0) + if (!g_pCompositor->getMonitorFromID(MONITOR)) PWINDOW->m_iMonitorID = 0; else PWINDOW->m_iMonitorID = MONITOR;