From d90d3a05de6c550ae2bf54347cda7b39074e63ef Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 18:23:09 +0100 Subject: * apt-pkg/indexrecords.cc: - do not create empty Entries as a sideeffect of Lookup() --- apt-pkg/indexrecords.cc | 5 ++++- debian/changelog | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index cdb9250e8..af2639beb 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -44,7 +44,10 @@ time_t indexRecords::GetValidUntil() const const indexRecords::checkSum *indexRecords::Lookup(const string MetaKey) { - return Entries[MetaKey]; + std::map::const_iterator sum = Entries.find(MetaKey); + if (sum == Entries.end()) + return NULL; + return sum->second; } bool indexRecords::Exists(string const &MetaKey) const diff --git a/debian/changelog b/debian/changelog index 6ef3c4a78..7461e9a25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - correctly ignore already (un)hold packages * apt-pkg/cachefile.cc: - clean up lost atomic cachefiles with 'clean' (Closes: #650513) + * apt-pkg/indexrecords.cc: + - do not create empty Entries as a sideeffect of Lookup() [ Steve Langasek ] * cmdline/apt-get.cc: @@ -47,7 +49,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Sat, 11 Feb 2012 22:34:29 +0100 + -- David Kalnischkies Sat, 18 Feb 2012 18:22:14 +0100 apt (0.8.16~exp12) experimental; urgency=low -- cgit v1.2.3