socket2: sanitize data for newlines

This commit is contained in:
Vaxry 2024-04-01 03:54:05 +01:00
parent ef7ac53e99
commit 416b3d6167

View file

@ -15,6 +15,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <string> #include <string>
#include <algorithm>
CEventManager::CEventManager() {} CEventManager::CEventManager() {}
@ -139,7 +140,9 @@ void CEventManager::postEvent(const SHyprIPCEvent event) {
} }
std::thread( std::thread(
[&](const SHyprIPCEvent ev) { [this](SHyprIPCEvent ev) {
std::replace(ev.data.begin(), ev.data.end(), '\n', ' ');
eventQueueMutex.lock(); eventQueueMutex.lock();
m_dQueuedEvents.push_back(ev); m_dQueuedEvents.push_back(ev);
eventQueueMutex.unlock(); eventQueueMutex.unlock();