Bug 1453795 - LibJAR - Initialize member fields in classes/ structures. r=aklotz
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Sat, 16 Jun 2018 14:03:28 +0300
changeset 479952 a79434a2511b80f92554c15317e2d6271849ace9
parent 479951 06f179ea49cfdde0bf9fe8b15adf94c75760c596
child 479953 e834d23a292972ab4250a8be00e6740c43e41db2
child 479985 4072740124c8aa15d5439983862e61281d437364
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1453795
milestone62.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 1453795 - LibJAR - Initialize member fields in classes/ structures. r=aklotz
modules/libjar/nsZipArchive.cpp
modules/libjar/zipwriter/nsDeflateConverter.h
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -1131,16 +1131,17 @@ PRTime nsZipItem::LastModTime()
   return GetModTime(Date(), Time());
 }
 
 nsZipCursor::nsZipCursor(nsZipItem *item, nsZipArchive *aZip, uint8_t* aBuf,
                          uint32_t aBufSize, bool doCRC)
   : mItem(item)
   , mBuf(aBuf)
   , mBufSize(aBufSize)
+  , mZs()
 #ifdef MOZ_JAR_BROTLI
   , mBrotliState(nullptr)
 #endif
   , mCRC(0)
   , mDoCRC(doCRC)
 {
   if (mItem->Compression() == DEFLATED) {
 #ifdef DEBUG
--- a/modules/libjar/zipwriter/nsDeflateConverter.h
+++ b/modules/libjar/zipwriter/nsDeflateConverter.h
@@ -21,22 +21,28 @@ class nsDeflateConverter final : public 
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSISTREAMCONVERTER
 
     nsDeflateConverter()
+        : mWrapMode(WRAP_NONE)
+        , mOffset(0)
+        , mZstream()
     {
         // 6 is Z_DEFAULT_COMPRESSION but we need the actual value
         mLevel = 6;
     }
 
     explicit nsDeflateConverter(int32_t level)
+        : mWrapMode(WRAP_NONE)
+        , mOffset(0)
+        , mZstream()
     {
         mLevel = level;
     }
 
 private:
 
     ~nsDeflateConverter()
     {