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

Unified Diff: content/ppapi_plugin/ppapi_thread.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: Made the test fixture much simpler. 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
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index 1bb38b1113a8498a4e4b70b9ae2efb4500a33324..b437de2390b80382232ce75e9860994ed4949a34 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -300,6 +300,8 @@ bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle,
// On POSIX, pass the renderer-side FD.
handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()),
true);
+ if (handle->socket.fd == -1)
+ return false;
#endif
// From here, the dispatcher will manage its own lifetime according to the

Powered by Google App Engine
This is Rietveld 408576698