mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 17:28:30 +00:00
AK: Add trivial structure validation to SharedBuffer
If we're sharing buffers, we only want to share trivial structures as anything else could potentially share internal pointers, which most likely is going to cause problems due to different address spaces. Fix the GUI::SystemTheme structure, which was not trivial, which is now caught at compile time. Fixes #3650
This commit is contained in:
@@ -57,7 +57,7 @@ RefPtr<Gfx::Bitmap> Client::decode_image(const ByteBuffer& encoded_data)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
memcpy(encoded_buffer->data(), encoded_data.data(), encoded_data.size());
|
||||
memcpy(encoded_buffer->data<void>(), encoded_data.data(), encoded_data.size());
|
||||
|
||||
encoded_buffer->seal();
|
||||
encoded_buffer->share_with(server_pid());
|
||||
|
||||
Reference in New Issue
Block a user