| Index: mojo/edk/system/node_controller.cc
|
| diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
|
| index 7c49bde1222188942e10f917e87bd9c31d318d62..888bf99882f5395bd9eec7ea51e56abaf1e92a86 100644
|
| --- a/mojo/edk/system/node_controller.cc
|
| +++ b/mojo/edk/system/node_controller.cc
|
| @@ -790,20 +790,28 @@ void NodeController::OnAcceptBrokerClient(const ports::NodeName& from_node,
|
| DVLOG(1) << "Child " << name_ << " accepted by broker " << broker_name;
|
| }
|
|
|
| -void NodeController::OnPortsMessage(Channel::MessagePtr channel_message) {
|
| +void NodeController::OnPortsMessage(const ports::NodeName& from_node,
|
| + Channel::MessagePtr channel_message) {
|
| DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
|
|
|
| void* data;
|
| size_t num_data_bytes;
|
| NodeChannel::GetPortsMessageData(
|
| channel_message.get(), &data, &num_data_bytes);
|
| + if (!num_data_bytes) {
|
| + DropPeer(from_node);
|
| + return;
|
| + }
|
|
|
| size_t num_header_bytes, num_payload_bytes, num_ports_bytes;
|
| - ports::Message::Parse(data,
|
| - num_data_bytes,
|
| - &num_header_bytes,
|
| - &num_payload_bytes,
|
| - &num_ports_bytes);
|
| + if (!ports::Message::Parse(data,
|
| + num_data_bytes,
|
| + &num_header_bytes,
|
| + &num_payload_bytes,
|
| + &num_ports_bytes)) {
|
| + DropPeer(from_node);
|
| + return;
|
| + }
|
|
|
| CHECK(channel_message);
|
| ports::ScopedMessage message(
|
|
|