Bug 1412646 - Initialize some uninitialized fields in security/manager/ r=keeler a=jcristau
authorTristan Bourvon <tbourvon@mozilla.com>
Tue, 31 Oct 2017 11:04:40 +0100
changeset 445420 ec25006fd49d9c3a926f5ddf537118a1a3b8e85c
parent 445419 da31a4d700181af9a20dc91766e5f971162ecf9e
child 445421 9ea92fd889d8a1edf8c2e4a9ce023852a1b0b6e1
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler, jcristau
bugs1412646
milestone58.0
Bug 1412646 - Initialize some uninitialized fields in security/manager/ r=keeler a=jcristau MozReview-Commit-ID: HGj8xw5Uq6j
security/manager/ssl/DataStorage.cpp
security/manager/ssl/ScopedNSSTypes.h
security/manager/ssl/SharedSSLState.cpp
security/manager/ssl/nsCertOverrideService.h
security/manager/ssl/nsCertTree.cpp
security/manager/ssl/nsNSSCallbacks.cpp
security/manager/ssl/nsNSSCertValidity.cpp
security/manager/ssl/nsNTLMAuthModule.h
security/manager/ssl/nsSecurityHeaderParser.cpp
security/manager/ssl/nsSiteSecurityService.cpp
--- a/security/manager/ssl/DataStorage.cpp
+++ b/security/manager/ssl/DataStorage.cpp
@@ -68,16 +68,17 @@ public:
 NS_IMPL_ISUPPORTS(DataStorageMemoryReporter, nsIMemoryReporter)
 
 NS_IMPL_ISUPPORTS(DataStorage, nsIObserver)
 
 StaticAutoPtr<DataStorage::DataStorages> DataStorage::sDataStorages;
 
 DataStorage::DataStorage(const nsString& aFilename)
   : mMutex("DataStorage::mMutex")
+  , mTimerDelay(sDataStorageDefaultTimerDelay)
   , mPendingWrite(false)
   , mShuttingDown(false)
   , mInitCalled(false)
   , mReadyMonitor("DataStorage::mReadyMonitor")
   , mReady(false)
   , mFilename(aFilename)
 {
 }
--- a/security/manager/ssl/ScopedNSSTypes.h
+++ b/security/manager/ssl/ScopedNSSTypes.h
@@ -104,16 +104,17 @@ MOZ_TYPE_SPECIFIC_UNIQUE_PTR_TEMPLATE(Un
  *   }
  *   rv = digest.End(SEC_OID_SHA256, digestContext);
  *   NS_ENSURE_SUCCESS(rv, rv)
  */
 class Digest
 {
 public:
   Digest()
+  : mItemBuf()
   {
     mItem.type = siBuffer;
     mItem.data = mItemBuf;
     mItem.len = 0;
   }
 
   nsresult DigestBuf(SECOidTag hashAlg, const uint8_t * buf, uint32_t len)
   {
--- a/security/manager/ssl/SharedSSLState.cpp
+++ b/security/manager/ssl/SharedSSLState.cpp
@@ -118,16 +118,17 @@ PrivateBrowsingObserver::Observe(nsISupp
 }
 
 SharedSSLState::SharedSSLState(uint32_t aTlsFlags)
 : mIOLayerHelpers(aTlsFlags)
 , mMutex("SharedSSLState::mMutex")
 , mSocketCreated(false)
 , mOCSPStaplingEnabled(false)
 , mOCSPMustStapleEnabled(false)
+, mSignedCertTimestampsEnabled(false)
 {
   mIOLayerHelpers.Init();
   if (!aTlsFlags) { // the per socket flags don't need memory
     mClientAuthRemember = new nsClientAuthRememberService();
     mClientAuthRemember->Init();
   }
 }
 
--- a/security/manager/ssl/nsCertOverrideService.h
+++ b/security/manager/ssl/nsCertOverrideService.h
@@ -25,16 +25,17 @@ public:
     None = 0,
     Untrusted = nsICertOverrideService::ERROR_UNTRUSTED,
     Mismatch = nsICertOverrideService::ERROR_MISMATCH,
     Time = nsICertOverrideService::ERROR_TIME,
   };
 
   nsCertOverride()
     : mPort(-1)
+    , mIsTemporary(false)
     , mOverrideBits(OverrideBits::None)
   {
   }
 
   nsCertOverride(const nsCertOverride &other)
   {
     this->operator=(other);
   }
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -50,17 +50,18 @@ CompareCacheHashEntryPtr::CompareCacheHa
 }
 
 CompareCacheHashEntryPtr::~CompareCacheHashEntryPtr()
 {
   delete entry;
 }
 
 CompareCacheHashEntry::CompareCacheHashEntry()
-:key(nullptr)
+  : key(nullptr)
+  , mCritInit()
 {
   for (int i = 0; i < max_criterions; ++i) {
     mCritInit[i] = false;
     mCrit[i].SetIsVoid(true);
   }
 }
 
 static bool
@@ -148,16 +149,18 @@ nsCertTreeDispInfo::GetHostPort(nsAStrin
   aHostPort = NS_ConvertUTF8toUTF16(hostPort);
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsCertTree, nsICertTree, nsITreeView)
 
 nsCertTree::nsCertTree()
   : mTreeArray(nullptr)
+  , mNumOrgs(0)
+  , mNumRows(0)
   , mCompareCache(&gMapOps, sizeof(CompareCacheHashEntryPtr),
                   kInitialCacheLength)
 {
   static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID);
 
   mNSSComponent = do_GetService(kNSSComponentCID);
   mOverrideService = do_GetService("@mozilla.org/security/certoverride;1");
   // Might be a different service if someone is overriding the contract
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -547,17 +547,19 @@ nsNSSHttpRequestSession::nsNSSHttpReques
 {
 }
 
 nsNSSHttpRequestSession::~nsNSSHttpRequestSession()
 {
 }
 
 nsHTTPListener::nsHTTPListener()
-: mResultData(nullptr),
+: mHttpRequestSucceeded(false),
+  mHttpResponseCode(0),
+  mResultData(nullptr),
   mResultLen(0),
   mLock("nsHTTPListener.mLock"),
   mCondition(mLock, "nsHTTPListener.mCondition"),
   mWaitFlag(true),
   mResponsibleForDoneSignal(false),
   mLoadGroup(nullptr),
   mLoadGroupOwnerThread(nullptr)
 {
--- a/security/manager/ssl/nsNSSCertValidity.cpp
+++ b/security/manager/ssl/nsNSSCertValidity.cpp
@@ -8,17 +8,19 @@
 #include "mozilla/Assertions.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsReadableUtils.h"
 
 NS_IMPL_ISUPPORTS(nsX509CertValidity, nsIX509CertValidity)
 
 nsX509CertValidity::nsX509CertValidity(const mozilla::UniqueCERTCertificate& cert)
-  : mTimesInitialized(false)
+  : mNotBefore(0)
+  , mNotAfter(0)
+  , mTimesInitialized(false)
 {
   MOZ_ASSERT(cert);
   if (!cert) {
     return;
   }
 
   nsNSSShutDownPreventionLock locker;
   if (isAlreadyShutDown()) {
--- a/security/manager/ssl/nsNTLMAuthModule.h
+++ b/security/manager/ssl/nsNTLMAuthModule.h
@@ -10,17 +10,17 @@
 #include "nsString.h"
 
 class nsNTLMAuthModule : public nsIAuthModule
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAUTHMODULE
 
-  nsNTLMAuthModule() {}
+  nsNTLMAuthModule() : mNTLMNegotiateSent(false) {}
 
   nsresult InitTest();
 
   static void SetSendLM(bool sendLM);
 
 protected:
   virtual ~nsNTLMAuthModule();
 
--- a/security/manager/ssl/nsSecurityHeaderParser.cpp
+++ b/security/manager/ssl/nsSecurityHeaderParser.cpp
@@ -47,16 +47,17 @@ IsQuotedPairSymbol(signed char chr) {
 }
 
 static mozilla::LazyLogModule sSHParserLog("nsSecurityHeaderParser");
 
 #define SHPARSERLOG(args) MOZ_LOG(sSHParserLog, mozilla::LogLevel::Debug, args)
 
 nsSecurityHeaderParser::nsSecurityHeaderParser(const nsCString& aHeader)
   : mCursor(aHeader.get())
+  , mDirective(nullptr)
   , mError(false)
 {
 }
 
 nsSecurityHeaderParser::~nsSecurityHeaderParser() {
   nsSecurityHeaderDirective *directive;
   while ((directive = mDirectives.popFirst())) {
     delete directive;
--- a/security/manager/ssl/nsSiteSecurityService.cpp
+++ b/security/manager/ssl/nsSiteSecurityService.cpp
@@ -490,16 +490,17 @@ SiteHPKPState::GetOriginAttributes(JSCon
 ////////////////////////////////////////////////////////////////////////////////
 
 const uint64_t kSixtyDaysInSeconds = 60 * 24 * 60 * 60;
 
 nsSiteSecurityService::nsSiteSecurityService()
   : mMaxMaxAge(kSixtyDaysInSeconds)
   , mUsePreloadList(true)
   , mPreloadListTimeOffset(0)
+  , mProcessPKPHeadersFromNonBuiltInRoots(false)
   , mDafsa(kDafsa)
 {
 }
 
 nsSiteSecurityService::~nsSiteSecurityService()
 {
 }