]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sid
authorMichael Vogt <mvo@debian.org>
Thu, 22 Aug 2013 20:24:27 +0000 (22:24 +0200)
committerMichael Vogt <mvo@debian.org>
Thu, 22 Aug 2013 20:24:27 +0000 (22:24 +0200)
Conflicts:
apt-pkg/tagfile.h

apt-pkg/acquire-item.cc
apt-pkg/contrib/cmndline.cc
apt-pkg/contrib/strutl.cc
apt-pkg/tagfile.cc
apt-pkg/tagfile.h

index 95dadcd6d2d7f7fc7905f9f62c1efb989d1ffedb..97b2d1e29a79bcbd63c573883970050a3f12c51a 100644 (file)
@@ -984,6 +984,8 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash,
    DestFile += ".decomp";
    Desc.URI = decompProg + ":" + FileName;
    QueueURI(Desc);
+
+   // FIXME: this points to a c++ string that goes out of scope
    Mode = decompProg.c_str();
 }
                                                                        /*}}}*/
index 8cef8036872d38021760497580403ada8931c148..2086d91ca88b10b68f8697e3b2aa4580ee999753 100644 (file)
@@ -397,6 +397,7 @@ bool CommandLine::DispatchArg(Dispatch *Map,bool NoMatch)
 void CommandLine::SaveInConfig(unsigned int const &argc, char const * const * const argv)
 {
    char cmdline[100 + argc * 50];
+   memset(cmdline, 0, sizeof(cmdline));
    unsigned int length = 0;
    bool lastWasOption = false;
    bool closeQuote = false;
index d06637155b48e7ea8977f1e7cbc5006ed01351af..0955b69f79a67f538e1af0f59359f543cc3f5bb5 100644 (file)
@@ -943,6 +943,8 @@ bool StrToTime(const string &Val,time_t &Result)
    Tm.tm_isdst = 0;
    if (Month[0] != 0)
       Tm.tm_mon = MonthConv(Month);
+   else
+      Tm.tm_mon = 0; // we don't have a month, so pick something
    Tm.tm_year -= 1900;
    
    // Convert to local time and then to GMT
index 10bc08d9501e385304adb93899ca8a113f3dc3e8..868adf3d2b8c719ee96c0c9b951685d809ab7251 100644 (file)
@@ -233,6 +233,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.
index 66c56799dd42c0408683e2cd0f074f8e9bba1679..518d3dbcd60bf8d8caa512371aac4c1ca56f12b4 100644 (file)
@@ -84,7 +84,7 @@ class pkgTagSection
       Stop = this->Stop;
    };
    
-   pkgTagSection() : Section(0), TagCount(0), d(NULL), Stop(0) {};
+   pkgTagSection();
    virtual ~pkgTagSection() {};
 };