diff options
author | Vaxry <[email protected]> | 2024-04-01 03:54:05 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-01 03:54:11 +0100 |
commit | 416b3d6167a996c7e94bd537cec20a12a0784efa (patch) | |
tree | 31ecc3b89867ac749dd6ba3b41e6481b8835addf | |
parent | ef7ac53e99c9c443241fd50a38e6edf528df3d7b (diff) | |
download | Hyprland-416b3d6167a996c7e94bd537cec20a12a0784efa.tar.gz Hyprland-416b3d6167a996c7e94bd537cec20a12a0784efa.zip |
socket2: sanitize data for newlines
-rw-r--r-- | src/managers/EventManager.cpp | 5 |
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(); |