summaryrefslogtreecommitdiffstats
path: root/tools/gn
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-28 05:16:59 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-28 05:16:59 +0000
commit5be06e403789b537097560fef594000626a61997 (patch)
tree7921ffcc481aa118a901086229fda96519973757 /tools/gn
parent96798670fd3a04b7bf820eb39c7fdbde25414e53 (diff)
downloadchromium_src-5be06e403789b537097560fef594000626a61997.zip
chromium_src-5be06e403789b537097560fef594000626a61997.tar.gz
chromium_src-5be06e403789b537097560fef594000626a61997.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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=237459 Review URL: https://codereview.chromium.org/71013004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn')
-rw-r--r--tools/gn/function_exec_script.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc
index b382575..cca62a3 100644
--- a/tools/gn/function_exec_script.cc
+++ b/tools/gn/function_exec_script.cc
@@ -85,8 +85,7 @@ bool ExecProcess(const CommandLine& cmdline,
base::FilePath::StringType cmdline_str(cmdline.GetCommandLineString());
- base::win::ScopedProcessInformation proc_info;
- STARTUPINFO start_info = { 0 };
+ STARTUPINFO start_info = {};
start_info.cb = sizeof(STARTUPINFO);
start_info.hStdOutput = out_write;
@@ -98,15 +97,17 @@ bool ExecProcess(const CommandLine& cmdline,
start_info.dwFlags |= STARTF_USESTDHANDLES;
// Create the child process.
+ PROCESS_INFORMATION temp_process_info = {};
if (!CreateProcess(NULL,
&cmdline_str[0],
NULL, NULL,
TRUE, // Handles are inherited.
0, NULL,
startup_dir.value().c_str(),
- &start_info, proc_info.Receive())) {
+ &start_info, &temp_process_info)) {
return false;
}
+ base::win::ScopedProcessInformation proc_info(temp_process_info);
// Close our writing end of pipes now. Otherwise later read would not be able
// to detect end of child's output.