Преглед изворни кода

memset() pkgTagSections data to make coverity happy

Michael Vogt пре 13 година
родитељ
комит
b40394c0ff
2 измењених фајлова са 11 додато и 1 уклоњено
  1. 10 0
      apt-pkg/tagfile.cc
  2. 1 1
      apt-pkg/tagfile.h

+ 10 - 0
apt-pkg/tagfile.cc

@@ -218,6 +218,16 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset)
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
+// pkgTagSection::pkgTagSection - Constructor				/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgTagSection::pkgTagSection()
+   : Section(0), TagCount(0), Stop(0), d(NULL)
+{
+   memset(&Indexes, 0, sizeof(Indexes));
+   memset(&AlphaIndexes, 0, sizeof(AlphaIndexes));
+}
+									/*}}}*/
 // TagSection::Scan - Scan for the end of the header information	/*{{{*/
 // TagSection::Scan - Scan for the end of the header information	/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* This looks for the first double new line in the data stream.
 /* This looks for the first double new line in the data stream.

+ 1 - 1
apt-pkg/tagfile.h

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