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:
Luke Wilde 2025-07-15 12:38:24 +01:00 committed by Tim Flynn
commit d6b9bd306c
Notes: github-actions[bot] 2025-07-15 13:21:19 +00:00

View file

@ -302,6 +302,9 @@ void MessagePort::read_from_transport()
{
VERIFY(m_enabled);
if (!is_entangled())
return;
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 };
IPC::Decoder decoder { stream, raw_message.fds };