Bug 1496364 - Minor refactor to stop uninitialized variable warning r=handyman
authorChris Martin <cmartin@mozilla.com>
Thu, 18 Oct 2018 19:14:05 +0000
changeset 500453 5441249fe31416707df434bc6f886d923543de46
parent 500452 9b976167b45aa1ea14c163e0dd4480ec1439289b
child 500454 9a05c09af3770321c9d3acd89204ac62f3fb1878
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershandyman
bugs1496364
milestone64.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 1496364 - Minor refactor to stop uninitialized variable warning r=handyman The compiler warns that jobLevel is uninitialized if none of the if-else conditions are true. Simply replacing the leading assert with a "else crash" tells the compiler that case will never actually happen. Differential Revision: https://phabricator.services.mozilla.com/D8841
security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
--- a/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
+++ b/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
@@ -384,17 +384,19 @@ SandboxBroker::SetSecurityLevelForConten
     accessTokenLevel = sandbox::USER_LIMITED;
     initialIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
     delayedIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
   } else if (aSandboxLevel == 2) {
     jobLevel = sandbox::JOB_INTERACTIVE;
     accessTokenLevel = sandbox::USER_INTERACTIVE;
     initialIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
     delayedIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
-  } else if (aSandboxLevel == 1) {
+  } else {
+    MOZ_ASSERT(aSandboxLevel == 1);
+    
     jobLevel = sandbox::JOB_NONE;
     accessTokenLevel = sandbox::USER_NON_ADMIN;
     initialIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
     delayedIntegrityLevel = sandbox::INTEGRITY_LEVEL_LOW;
   }
 
   // If the process will handle file: URLs, don't allow settings that
   // block reads.