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

Side by Side Diff: ipc/ipc_message_pipe_reader.cc

Issue 2188173003: Fix nullptr deref in remote interface acquisition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ipc/ipc_channel_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/ipc_message_pipe_reader.h" 5 #include "ipc/ipc_message_pipe_reader.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 result = mojo::WriteMessageNew(sender_pipe_, mojo_message->TakeMojoMessage(), 109 result = mojo::WriteMessageNew(sender_pipe_, mojo_message->TakeMojoMessage(),
110 MOJO_WRITE_MESSAGE_FLAG_NONE); 110 MOJO_WRITE_MESSAGE_FLAG_NONE);
111 111
112 DVLOG(4) << "Send " << message->type() << ": " << message->size(); 112 DVLOG(4) << "Send " << message->type() << ": " << message->size();
113 return result == MOJO_RESULT_OK; 113 return result == MOJO_RESULT_OK;
114 } 114 }
115 115
116 void MessagePipeReader::GetRemoteInterface( 116 void MessagePipeReader::GetRemoteInterface(
117 const std::string& name, 117 const std::string& name,
118 mojo::ScopedInterfaceEndpointHandle handle) { 118 mojo::ScopedInterfaceEndpointHandle handle) {
119 if (!sender_.is_bound())
120 return;
119 mojom::GenericInterfaceAssociatedRequest request; 121 mojom::GenericInterfaceAssociatedRequest request;
120 request.Bind(std::move(handle)); 122 request.Bind(std::move(handle));
121 sender_->GetAssociatedInterface(name, std::move(request)); 123 sender_->GetAssociatedInterface(name, std::move(request));
122 } 124 }
123 125
124 void MessagePipeReader::SetPeerPid(int32_t peer_pid) { 126 void MessagePipeReader::SetPeerPid(int32_t peer_pid) {
125 peer_pid_ = peer_pid; 127 peer_pid_ = peer_pid;
126 delegate_->OnPeerPidReceived(); 128 delegate_->OnPeerPidReceived();
127 } 129 }
128 130
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 165
164 Close(); 166 Close();
165 167
166 // NOTE: The delegate call below may delete |this|. 168 // NOTE: The delegate call below may delete |this|.
167 if (delegate_) 169 if (delegate_)
168 delegate_->OnPipeError(); 170 delegate_->OnPipeError();
169 } 171 }
170 172
171 } // namespace internal 173 } // namespace internal
172 } // namespace IPC 174 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698