]> git.saurik.com Git - apt.git/commitdiff
some more coverity fixes
authorMichael Vogt <mvo@debian.org>
Mon, 12 Aug 2013 15:24:15 +0000 (17:24 +0200)
committerMichael Vogt <mvo@debian.org>
Mon, 12 Aug 2013 15:24:15 +0000 (17:24 +0200)
apt-pkg/acquire-item.cc
apt-pkg/contrib/cmndline.cc
apt-pkg/contrib/strutl.cc

index 7bcdf285bcddfc5ad8800e9641106fdf83f3fd77..f70cabeff9764c7e3f66f75a4fd3dbbf943de1ed 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 75d02cad46972cc262906f7379185c5127f446e5..d77ef454056e78e3e6be31ff46781edf3fb20465 100644 (file)
@@ -361,6 +361,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 df02c3499c5b681041c27b9a3e9eef4c4fe6b535..b70a62a47ee960bd3b85846e212199f7caff5882 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