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

Unified Diff: sandbox/win/src/broker_services.cc

Issue 1077893005: UpdateProcThreadAttribute has a restriction that its lpValue parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: sandbox/win/src/broker_services.cc
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc
index 8fa7f0d655168a5427287a72228c8f036c4646e4..5d8061fd48998b0af36f72144409dbcd05a9d837 100644
--- a/sandbox/win/src/broker_services.cc
+++ b/sandbox/win/src/broker_services.cc
@@ -401,6 +401,11 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
// Initialize the startup information from the policy.
base::win::StartupInformation startup_info;
+ // The liftime of |mitigations| has to be at least as long as |startup_info|
+ // because |UpdateProcThreadAttribute| requires that its |lpValue| parameter
+ // persist until |DeleteProcThreadAttributeList| is called;
+ // StartupInformation's destructor makes such a call.
+ DWORD64 mitigations;
base::string16 desktop = policy_base->GetAlternateDesktop();
if (!desktop.empty()) {
startup_info.startup_info()->lpDesktop =
@@ -415,7 +420,6 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
if (app_container)
++attribute_count;
- DWORD64 mitigations;
size_t mitigations_size;
ConvertProcessMitigationsToPolicy(policy->GetProcessMitigations(),
&mitigations, &mitigations_size);
« 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