diff options
author | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:03:43 +0000 |
---|---|---|
committer | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:03:43 +0000 |
commit | 166a865e356b1841a1e3bf3b32bc5aaf13215f6e (patch) | |
tree | 6aeefbef7ebeb5eb1a232b6c88645da240d73a79 /components | |
parent | 4cb7699e349fabe62f9b4af7894361c4334161f9 (diff) | |
download | chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.zip chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.tar.gz chromium_src-166a865e356b1841a1e3bf3b32bc5aaf13215f6e.tar.bz2 |
Base: Remove Receive() from ScopedHandle.
In general, the OS API contract doesn't guarantee that output variables are
not modified on failure, so a Reeceive pattern is fundamentally insecure.
BUG=318531
TEST=current tests
tbr'ing owners for the consumers.
TBR=jvoung@chromium.org, thakis@chromium.org, sergeyu@chromium.org, grt@chromium.org, gene@chromium.org, youngki@chromium.org
Review URL: https://codereview.chromium.org/71013004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r-- | components/nacl/browser/nacl_process_host.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc index d40af96..aa79f4f 100644 --- a/components/nacl/browser/nacl_process_host.cc +++ b/components/nacl/browser/nacl_process_host.cc @@ -977,7 +977,7 @@ bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, debug_exception_handler_requested_ = true; base::ProcessId nacl_pid = base::GetProcId(process_->GetData().handle); - base::win::ScopedHandle process_handle; + base::ProcessHandle temp_handle; // We cannot use process_->GetData().handle because it does not have // the necessary access rights. We open the new handle here rather // than in the NaCl broker process in case the NaCl loader process @@ -996,10 +996,11 @@ bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, base::kProcessAccessVMWrite | base::kProcessAccessDuplicateHandle | base::kProcessAccessWaitForTermination, - process_handle.Receive())) { + &temp_handle)) { LOG(ERROR) << "Failed to get process handle"; return false; } + base::win::ScopedHandle process_handle(temp_handle); attach_debug_exception_handler_reply_msg_.reset(reply_msg); // If the NaCl loader is 64-bit, the process running its debug |