mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 01:42:17 +00:00
LibWeb: Assume structured deserialization creates the correct type
Most locations already make this assumption, but we had a few that would silently ignore data mismatches. Let's just always assume the type is correct for now. If a bad actor has a hold of our transport socket, it's probably better to crash WebContent than to continue on with incorrect data. In the future, maybe we will want to throw an exception instead.
This commit is contained in:
parent
ed71db45e7
commit
d471b52b0e
Notes:
github-actions[bot]
2025-07-18 14:10:28 +00:00
Author: https://github.com/trflynn89
Commit: d471b52b0e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5492
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/shannonbooth
3 changed files with 3 additions and 10 deletions
|
@ -210,9 +210,7 @@ WebIDL::ExceptionOr<void> ImageData::deserialization_steps(HTML::TransferDataDec
|
|||
|
||||
// 1. Initialize value's data attribute to the sub-deserialization of serialized.[[Data]].
|
||||
auto deserialized = TRY(structured_deserialize_internal(vm, serialized, realm, memory));
|
||||
|
||||
if (auto* data = as_if<JS::Uint8ClampedArray>(deserialized.as_object()))
|
||||
m_data = *data;
|
||||
m_data = as<JS::Uint8ClampedArray>(deserialized.as_object());
|
||||
|
||||
// 2. Initialize value's width attribute to serialized.[[Width]].
|
||||
auto width = serialized.decode<int>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue