mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:15:00 +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:
parent
87f20f704c
commit
7399874479
16 changed files with 48 additions and 29 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue