mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
Seal clipboard buffers after copying data into them.
This is just a quick safety mechanism to ensure that nobody alters the contents of a clipping after it's been set. Ultimately this will be replaced by a more sophisticated SHM object.
This commit is contained in:
@@ -336,6 +336,7 @@ void WSClientConnection::handle_request(WSAPIGetClipboardContentsRequest&)
|
||||
RetainPtr<SharedBuffer> shared_buffer = SharedBuffer::create(m_pid, WSClipboard::the().size());
|
||||
ASSERT(shared_buffer);
|
||||
memcpy(shared_buffer->data(), WSClipboard::the().data(), WSClipboard::the().size());
|
||||
shared_buffer->seal();
|
||||
response.clipboard.shared_buffer_id = shared_buffer->shared_buffer_id();
|
||||
response.clipboard.contents_size = WSClipboard::the().size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user