Переглянути джерело

fix some unitialized data members

Michael Vogt 13 роки тому
батько
коміт
4ccd3b3ce6
3 змінених файлів з 5 додано та 3 видалено
  1. 1 1
      apt-pkg/cdrom.h
  2. 3 1
      apt-pkg/contrib/sha2.h
  3. 1 1
      apt-pkg/tagfile.h

+ 1 - 1
apt-pkg/cdrom.h

@@ -18,7 +18,7 @@ class pkgCdromStatus							/*{{{*/
    int totalSteps;
 
  public:
-   pkgCdromStatus() {};
+   pkgCdromStatus() : totalSteps(0) {};
    virtual ~pkgCdromStatus() {};
 
    // total steps

+ 3 - 1
apt-pkg/contrib/sha2.h

@@ -60,10 +60,11 @@ class SHA256Summation : public SHA2SummationBase
       res.Set(Sum);
       return res;
    };
-   SHA256Summation() 
+   SHA256Summation()
    {
       SHA256_Init(&ctx);
       Done = false;
+      memset(&Sum, 0, sizeof(Sum));
    };
 };
 
@@ -96,6 +97,7 @@ class SHA512Summation : public SHA2SummationBase
    {
       SHA512_Init(&ctx);
       Done = false;
+      memset(&Sum, 0, sizeof(Sum));
    };
 };
 

+ 1 - 1
apt-pkg/tagfile.h

@@ -84,7 +84,7 @@ class pkgTagSection
       Stop = this->Stop;
    };
    
-   pkgTagSection() : Section(0), TagCount(0), Stop(0) {};
+   pkgTagSection() : Section(0), TagCount(0), Stop(0), d(NULL) {};
    virtual ~pkgTagSection() {};
 };