mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +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:
@@ -50,7 +50,7 @@ void Download::did_finish(Badge<Client>, bool success, Optional<u32> status_code
|
||||
RefPtr<SharedBuffer> shared_buffer;
|
||||
if (success && shbuf_id != -1) {
|
||||
shared_buffer = SharedBuffer::create_from_shbuf_id(shbuf_id);
|
||||
payload = ByteBuffer::wrap(shared_buffer->data(), total_size);
|
||||
payload = ByteBuffer::wrap(shared_buffer->data<void>(), total_size);
|
||||
}
|
||||
|
||||
// FIXME: It's a bit silly that we copy the response headers here just so we can move them into a HashMap with different traits.
|
||||
|
||||
Reference in New Issue
Block a user