Просмотр исходного кода

memset() pkgTagSections data to make coverity happy

Michael Vogt лет назад: 13
Родитель
Сommit
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;
 }
 									/*}}}*/
+// 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	/*{{{*/
 // ---------------------------------------------------------------------
 /* 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;
    };
    
-   pkgTagSection() : Section(0), TagCount(0), Stop(0), d(NULL) {};
+   pkgTagSection();
    virtual ~pkgTagSection() {};
 };