aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-04-01 03:54:05 +0100
committerVaxry <[email protected]>2024-04-01 03:54:11 +0100
commit416b3d6167a996c7e94bd537cec20a12a0784efa (patch)
tree31ecc3b89867ac749dd6ba3b41e6481b8835addf
parentef7ac53e99c9c443241fd50a38e6edf528df3d7b (diff)
downloadHyprland-416b3d6167a996c7e94bd537cec20a12a0784efa.tar.gz
Hyprland-416b3d6167a996c7e94bd537cec20a12a0784efa.zip
socket2: sanitize data for newlines
-rw-r--r--src/managers/EventManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/managers/EventManager.cpp b/src/managers/EventManager.cpp
index 8365c8c8..57824430 100644
--- a/src/managers/EventManager.cpp
+++ b/src/managers/EventManager.cpp
@@ -15,6 +15,7 @@
#include <sys/ioctl.h>
#include <string>
+#include <algorithm>
CEventManager::CEventManager() {}
@@ -139,7 +140,9 @@ void CEventManager::postEvent(const SHyprIPCEvent event) {
}
std::thread(
- [&](const SHyprIPCEvent ev) {
+ [this](SHyprIPCEvent ev) {
+ std::replace(ev.data.begin(), ev.data.end(), '\n', ' ');
+
eventQueueMutex.lock();
m_dQueuedEvents.push_back(ev);
eventQueueMutex.unlock();