diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-02-18 18:23:09 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-02-18 18:23:09 +0100 |
commit | d90d3a05de6c550ae2bf54347cda7b39074e63ef (patch) | |
tree | deecd4b95567e04d6537a6abb6ae4bd09bdf238f /apt-pkg | |
parent | fbb2c7e04dd3155983560e0b01a71fd8f62f0b1b (diff) |
* apt-pkg/indexrecords.cc:
- do not create empty Entries as a sideeffect of Lookup()
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/indexrecords.cc | 5 |
1 files changed, 4 insertions, 1 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<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 |