Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: mojo/edk/system/data_pipe_consumer_dispatcher.cc

Issue 1936333002: [mojo-edk] Fix uninitialized reads in EDK dispatchers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 size_t previous_bytes_available = bytes_available_; 518 size_t previous_bytes_available = bytes_available_;
519 519
520 ports::PortStatus port_status; 520 ports::PortStatus port_status;
521 if (node_controller_->node()->GetStatus(control_port_, &port_status) != 521 if (node_controller_->node()->GetStatus(control_port_, &port_status) !=
522 ports::OK || 522 ports::OK ||
523 !port_status.receiving_messages) { 523 !port_status.receiving_messages) {
524 DVLOG(1) << "Data pipe consumer " << pipe_id_ << " is aware of peer closure" 524 DVLOG(1) << "Data pipe consumer " << pipe_id_ << " is aware of peer closure"
525 << " [control_port=" << control_port_.name() << "]"; 525 << " [control_port=" << control_port_.name() << "]";
526 526
527 peer_closed_ = true; 527 peer_closed_ = true;
528 } 528 } else if (port_status.has_messages && !in_transit_) {
Anand Mistry (off Chromium) 2016/05/04 00:50:03 I'm still pushing back on this construct because I
Ken Rockot(use gerrit already) 2016/05/04 02:57:05 done
529
530 if (port_status.has_messages && !in_transit_) {
531 ports::ScopedMessage message; 529 ports::ScopedMessage message;
532 do { 530 do {
533 int rv = node_controller_->node()->GetMessageIf(control_port_, nullptr, 531 int rv = node_controller_->node()->GetMessageIf(control_port_, nullptr,
534 &message); 532 &message);
535 if (rv != ports::OK) 533 if (rv != ports::OK)
536 peer_closed_ = true; 534 peer_closed_ = true;
537 if (message) { 535 if (message) {
538 const DataPipeControlMessage* m = 536 const DataPipeControlMessage* m =
539 static_cast<const DataPipeControlMessage*>( 537 static_cast<const DataPipeControlMessage*>(
540 message->payload_bytes()); 538 message->payload_bytes());
(...skipping 21 matching lines...) Expand all
562 } 560 }
563 561
564 if (peer_closed_ != was_peer_closed || 562 if (peer_closed_ != was_peer_closed ||
565 bytes_available_ != previous_bytes_available) { 563 bytes_available_ != previous_bytes_available) {
566 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); 564 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock());
567 } 565 }
568 } 566 }
569 567
570 } // namespace edk 568 } // namespace edk
571 } // namespace mojo 569 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698