* apt-pkg/indexrecords.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 18 Feb 2012 17:23:09 +0000 (18:23 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 18 Feb 2012 17:23:09 +0000 (18:23 +0100)
  - do not create empty Entries as a sideeffect of Lookup()

apt-pkg/indexrecords.cc
debian/changelog

index cdb9250..af2639b 100644 (file)
@@ -44,7 +44,10 @@ time_t indexRecords::GetValidUntil() const
 
 const indexRecords::checkSum *indexRecords::Lookup(const string MetaKey)
 {
-   return Entries[MetaKey];
+   std::map<std::string, indexRecords::checkSum* >::const_iterator sum = Entries.find(MetaKey);
+   if (sum == Entries.end())
+      return NULL;
+   return sum->second;
 }
 
 bool indexRecords::Exists(string const &MetaKey) const
index 6ef3c4a..7461e9a 100644 (file)
@@ -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 <kalnischkies@gmail.com>  Sat, 11 Feb 2012 22:34:29 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 18 Feb 2012 18:22:14 +0100
 
 apt (0.8.16~exp12) experimental; urgency=low