Bug 1350309 - Fix uninitialized variables in updatehelper.cpp
Originally |consent| and |secureDesktop| are always used even when |success| is FALSE, and |consent| and |secureDesktop| are uninitialized in this case. In this patch, |isUnpromptedElevation| is set only when |success| is TRUE.
MozReview-Commit-ID: Dik8NG7zcCa
--- a/toolkit/mozapps/update/common/updatehelper.cpp
+++ b/toolkit/mozapps/update/common/updatehelper.cpp
@@ -595,13 +595,16 @@ IsUnpromptedElevation(BOOL &isUnprompted
return FALSE;
}
DWORD consent, secureDesktop;
BOOL success = GetDWORDValue(baseKey, L"ConsentPromptBehaviorAdmin",
consent);
success = success &&
GetDWORDValue(baseKey, L"PromptOnSecureDesktop", secureDesktop);
- isUnpromptedElevation = !consent && !secureDesktop;
RegCloseKey(baseKey);
+ if (success) {
+ isUnpromptedElevation = !consent && !secureDesktop;
+ }
+
return success;
}