Bug 1146874 - Part 1: Check that Windows sandboxed process starts correctly. r=tabraldes, a=lizzard
authorBob Owen <bobowencode@gmail.com>
Mon, 11 May 2015 08:24:39 +0100
changeset 274635 cbf89fb08ec7e3137d3347e1b809ace99a041897
parent 274634 0af65151a322b0f67957d647cf3be644be3af2a4
child 274636 add2083dc0ffccb44b0bf91d5157f390efd1a1ff
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstabraldes, lizzard
bugs1146874
milestone40.0a2
Bug 1146874 - Part 1: Check that Windows sandboxed process starts correctly. r=tabraldes, a=lizzard
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;