summaryrefslogtreecommitdiff
path: root/src/cmdline/cmdline_util.cc
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2008-03-04 22:22:26 -0800
committerDaniel Burrows <dburrows@debian.org>2008-03-04 22:22:26 -0800
commitab8b140f17fd3d89276d703467ef36c95569fab8 (patch)
tree6708e96e4bd4bcb86d863176feb42dc215852640 /src/cmdline/cmdline_util.cc
parentb4fffa63f8630b2c0400ce43bc72a1a6e6827afa (diff)
downloadaptitude-ab8b140f17fd3d89276d703467ef36c95569fab8.tar.gz
Don't segfault in "update" et al when there's an error parsing the package lists.
Diffstat (limited to 'src/cmdline/cmdline_util.cc')
-rw-r--r--src/cmdline/cmdline_util.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmdline/cmdline_util.cc b/src/cmdline/cmdline_util.cc
index 4197bdf2..37002c70 100644
--- a/src/cmdline/cmdline_util.cc
+++ b/src/cmdline/cmdline_util.cc
@@ -231,6 +231,9 @@ namespace
int num_new = 0;
int num_broken = 0;
+ if(apt_cache_file == NULL)
+ return stats(0, 0, 0);
+
for(pkgCache::PkgIterator p = (*apt_cache_file)->PkgBegin();
!p.end(); ++p)
{