fix: remove ClipboardSending handler in proxy destructors (UAF)

fixes: #9842
This commit is contained in:
Charles Le (cle-air-m3) 2026-06-09 23:32:33 -07:00 committed by Nick Bolton
parent 750fdbeb34
commit 13f98475a2
3 changed files with 7 additions and 1 deletions

View file

@ -55,6 +55,7 @@ ServerProxy::~ServerProxy()
{
setKeepAliveRate(-1.0);
m_events->removeHandler(EventTypes::StreamInputReady, m_stream->getEventTarget());
m_events->removeHandler(EventTypes::ClipboardSending, this);
}
void ServerProxy::resetKeepAliveAlarm()

View file

@ -26,6 +26,11 @@ ClientProxy1_6::ClientProxy1_6(const std::string &name, deskflow::IStream *strea
});
}
ClientProxy1_6::~ClientProxy1_6()
{
m_events->removeHandler(EventTypes::ClipboardSending, this);
}
void ClientProxy1_6::setClipboard(ClipboardID id, const IClipboard *clipboard)
{
// ignore if this clipboard is already clean

View file

@ -16,7 +16,7 @@ class ClientProxy1_6 : public ClientProxy1_5
{
public:
ClientProxy1_6(const std::string &name, deskflow::IStream *adoptedStream, Server *server, IEventQueue *events);
~ClientProxy1_6() override = default;
~ClientProxy1_6() override;
void setClipboard(ClipboardID id, const IClipboard *clipboard) override;
bool recvClipboard() override;