Bug 1146874 Part 1: Check that Windows sandboxed process starts correctly. r=tabraldes
authorBob Owen <bobowencode@gmail.com>
Mon, 11 May 2015 08:24:39 +0100
changeset 243335 0d036289fac1942d4c33ecbc9090c171c0ea91c5
parent 243334 f39f5779392dc209e7c741a94f89d9ba32ab4653
child 243336 c049d77c06fd43103d67b055fcae99a335795266
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherdermozilla-central@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstabraldes
bugs1146874
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1146874 Part 1: Check that Windows sandboxed process starts correctly. r=tabraldes
security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
--- a/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
+++ b/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
@@ -47,19 +47,22 @@ SandboxBroker::LaunchApp(const wchar_t *
   mPolicy->SetStderrHandle(::GetStdHandle(STD_ERROR_HANDLE));
 
   // If logging enabled, set up the policy.
   if (aEnableLogging) {
     mozilla::sandboxing::ApplyLoggingPolicy(*mPolicy);
   }
 
   // Ceate the sandboxed process
-  PROCESS_INFORMATION targetInfo;
+  PROCESS_INFORMATION targetInfo = {0};
   sandbox::ResultCode result;
   result = sBrokerService->SpawnTarget(aPath, aArguments, mPolicy, &targetInfo);
+  if (sandbox::SBOX_ALL_OK != result) {
+    return false;
+  }
 
   // The sandboxed process is started in a suspended state, resume it now that
   // we've set things up.
   ResumeThread(targetInfo.hThread);
   CloseHandle(targetInfo.hThread);
 
   // Return the process handle to the caller
   *aProcessHandle = targetInfo.hProcess;