diff options
-rw-r--r-- | apt-pkg/acquire-item.cc | 2 | ||||
-rw-r--r-- | apt-pkg/contrib/cmndline.cc | 1 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 2 | ||||
-rw-r--r-- | apt-pkg/tagfile.cc | 10 | ||||
-rw-r--r-- | apt-pkg/tagfile.h | 2 | ||||
-rwxr-xr-x | test/integration/test-bug-507998-dist-upgrade-recommends | 25 |
6 files changed, 41 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 95dadcd6d..97b2d1e29 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -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(); } /*}}}*/ diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 8cef80368..2086d91ca 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -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; diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index d06637155..0955b69f7 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -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 diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 10bc08d95..868adf3d2 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -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. diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 66c56799d..518d3dbcd 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -84,7 +84,7 @@ class pkgTagSection Stop = this->Stop; }; - pkgTagSection() : Section(0), TagCount(0), d(NULL), Stop(0) {}; + pkgTagSection(); virtual ~pkgTagSection() {}; }; diff --git a/test/integration/test-bug-507998-dist-upgrade-recommends b/test/integration/test-bug-507998-dist-upgrade-recommends new file mode 100755 index 000000000..513421a94 --- /dev/null +++ b/test/integration/test-bug-507998-dist-upgrade-recommends @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'tshark' 'amd64' '1.0.4-1' 'Depends: wireshark-common' +insertinstalledpackage 'wireshark-common' 'amd64' '1.0.4-1' 'Recommends: wireshark (>= 1.0.4-1) | tshark (>= 1.0.4-1)' +insertpackage 'unstable' 'tshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)' +insertpackage 'unstable' 'wireshark-common' 'amd64' '1.2.1-2' 'Recommends: wireshark (>= 1.2.1-2) | tshark (>= 1.2.1-2)' +insertpackage 'unstable' 'wireshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + tshark wireshark-common +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst wireshark-common [1.0.4-1] (1.2.1-2 unstable [amd64]) +Inst tshark [1.0.4-1] (1.2.1-2 unstable [amd64]) +Conf wireshark-common (1.2.1-2 unstable [amd64]) +Conf tshark (1.2.1-2 unstable [amd64])' aptget dist-upgrade -s |