From 416b3d6167a996c7e94bd537cec20a12a0784efa Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 1 Apr 2024 03:54:05 +0100 Subject: [PATCH] socket2: sanitize data for newlines --- src/managers/EventManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 #include +#include 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();