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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 8436008: Add check on invalid file descriptor at both broker and renderer sides. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Change comment about the mock_process_. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.cc ('k') | content/renderer/pepper_plugin_delegate_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc
index 56aa7b943deedb60c7ab35d4b1082ea71050ee0d..43b8fd4a50218178856d0e80c7263e408be985f7 100644
--- a/content/renderer/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper_plugin_delegate_impl.cc
@@ -480,13 +480,21 @@ BrokerDispatcherWrapper::~BrokerDispatcherWrapper() {
bool BrokerDispatcherWrapper::Init(
base::ProcessHandle broker_process_handle,
const IPC::ChannelHandle& channel_handle) {
+if (channel_handle.name.empty())
+ return false;
+
+#if defined(OS_POSIX)
+ if (channel_handle.socket.fd == -1)
+ return false;
+#endif
+
dispatcher_delegate_.reset(new DispatcherDelegate);
dispatcher_.reset(
new ppapi::proxy::BrokerHostDispatcher(broker_process_handle));
if (!dispatcher_->InitBrokerWithChannel(dispatcher_delegate_.get(),
channel_handle,
- true)) {
+ true)) { // is_client
dispatcher_.reset();
dispatcher_delegate_.reset();
return false;
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.cc ('k') | content/renderer/pepper_plugin_delegate_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698