summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:58:48 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:58:48 +0000
commit2a3f3893b2197fa0604e09fb662f1112a453e7f4 (patch)
treeec2d36ba8e4108e9fb29a8c5787bb128817837f7 /apt-pkg/algorithms.cc
parent7eb38c769124c387a72306ff304038356a1bd3e1 (diff)
Fixed a possible segfault
Author: jgg Date: 2001-12-26 06:47:37 GMT Fixed a possible segfault
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 322c667f2..2dd9aaaf1 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: algorithms.cc,v 1.36 2001/05/27 03:46:10 jgg Exp $
+// $Id: algorithms.cc,v 1.37 2001/12/26 06:47:37 jgg Exp $
/* ######################################################################
Algorithms - A set of misc algorithms
@@ -225,7 +225,8 @@ bool pkgApplyStatus(pkgDepCache &Cache)
else
{
// Is this right? Will dpkg choke on an upgrade?
- if (Cache[I].CandidateVerIter(Cache).Downloadable() == true)
+ if (Cache[I].CandidateVer != 0 &&
+ Cache[I].CandidateVerIter(Cache).Downloadable() == true)
Cache.MarkInstall(I);
else
return _error->Error(_("The package %s needs to be reinstalled, "
@@ -246,7 +247,8 @@ bool pkgApplyStatus(pkgDepCache &Cache)
Cache.MarkKeep(I);
else
{
- if (Cache[I].CandidateVerIter(Cache).Downloadable() == true)
+ if (Cache[I].CandidateVer != 0 &&
+ Cache[I].CandidateVerIter(Cache).Downloadable() == true)
Cache.MarkInstall(I);
else
Cache.MarkDelete(I);