mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Don't read from MessagePort transport if it's not entangled
If the MessagePort is not entangled, then m_transport is null, meaning it's not valid to read from the transport. This fixes the cross-piping streams WPT crash test crashing in the upcoming commit.
This commit is contained in:
parent
cb1c388ee3
commit
d6b9bd306c
Notes:
github-actions[bot]
2025-07-15 13:21:19 +00:00
Author: https://github.com/Lubrsi
Commit: d6b9bd306c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5443
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 3 additions and 0 deletions
|
@ -302,6 +302,9 @@ void MessagePort::read_from_transport()
|
||||||
{
|
{
|
||||||
VERIFY(m_enabled);
|
VERIFY(m_enabled);
|
||||||
|
|
||||||
|
if (!is_entangled())
|
||||||
|
return;
|
||||||
|
|
||||||
auto schedule_shutdown = m_transport->read_as_many_messages_as_possible_without_blocking([this](auto&& raw_message) {
|
auto schedule_shutdown = m_transport->read_as_many_messages_as_possible_without_blocking([this](auto&& raw_message) {
|
||||||
FixedMemoryStream stream { raw_message.bytes.span(), FixedMemoryStream::Mode::ReadOnly };
|
FixedMemoryStream stream { raw_message.bytes.span(), FixedMemoryStream::Mode::ReadOnly };
|
||||||
IPC::Decoder decoder { stream, raw_message.fds };
|
IPC::Decoder decoder { stream, raw_message.fds };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue