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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 12087104: Prevent calling GetProcId with a null process handle in PpapiPluginProcessHost::RequestPluginChannel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ppapi_plugin_process_host.cc
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index e279b99a3972c2302efb00c5ec4ef6a62a60dca9..3d07a60686fba145b164992813c2ba0383eec4ef 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -298,11 +298,13 @@ void PpapiPluginProcessHost::RequestPluginChannel(Client* client) {
int renderer_child_id;
client->GetPpapiChannelInfo(&process_handle, &renderer_child_id);
+ base::ProcessId process_id = (process_handle == base::kNullProcessHandle) ?
+ 0 : base::GetProcId(process_handle);
+
// We can't send any sync messages from the browser because it might lead to
// a hang. See the similar code in PluginProcessHost for more description.
PpapiMsg_CreateChannel* msg = new PpapiMsg_CreateChannel(
- base::GetProcId(process_handle), renderer_child_id,
- client->OffTheRecord());
+ process_id, renderer_child_id, client->OffTheRecord());
msg->set_unblock(true);
if (Send(msg)) {
sent_requests_.push(client);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698