summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 01:03:43 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 01:03:43 +0000
commit166a865e356b1841a1e3bf3b32bc5aaf13215f6e (patch)
tree6aeefbef7ebeb5eb1a232b6c88645da240d73a79 /win8
parent4cb7699e349fabe62f9b4af7894361c4334161f9 (diff)
downloadchromium_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 'win8')
-rw-r--r--win8/delegate_execute/command_execute_impl.cc5
-rw-r--r--win8/test/metro_registration_helper.cc7
2 files changed, 7 insertions, 5 deletions
diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc
index 5f6cc19..f52037b 100644
--- a/win8/delegate_execute/command_execute_impl.cc
+++ b/win8/delegate_execute/command_execute_impl.cc
@@ -487,12 +487,13 @@ HRESULT CommandExecuteImpl::LaunchDesktopChrome() {
AtlTrace("Formatted command line is %ls\n", command_line.c_str());
- base::win::ScopedProcessInformation proc_info;
+ PROCESS_INFORMATION temp_process_info = {};
BOOL ret = CreateProcess(chrome_exe_.value().c_str(),
const_cast<LPWSTR>(command_line.c_str()),
NULL, NULL, FALSE, 0, NULL, NULL, &start_info_,
- proc_info.Receive());
+ &temp_process_info);
if (ret) {
+ base::win::ScopedProcessInformation proc_info(temp_process_info);
AtlTrace("Process id is %d\n", proc_info.process_id());
AllowSetForegroundWindow(proc_info.process_id());
} else {
diff --git a/win8/test/metro_registration_helper.cc b/win8/test/metro_registration_helper.cc
index bcf5644..75319a9 100644
--- a/win8/test/metro_registration_helper.cc
+++ b/win8/test/metro_registration_helper.cc
@@ -54,11 +54,12 @@ bool RegisterTestDefaultBrowser() {
register_command.AppendArg("/RegServer");
base::win::ScopedHandle register_handle;
- if (base::LaunchProcess(register_command, base::LaunchOptions(),
- register_handle.Receive())) {
+ if (base::LaunchProcess(register_command.GetCommandLineString(),
+ base::LaunchOptions(),
+ &register_handle)) {
int ret = 0;
if (base::WaitForExitCodeWithTimeout(
- register_handle, &ret,
+ register_handle.Get(), &ret,
base::TimeDelta::FromSeconds(kRegistrationTimeoutSeconds))) {
if (ret == 0) {
return true;