Do not try to cast a pkgDepCache::Policy to a pkgCache
authorMichael Vogt <mvo@debian.org>
Tue, 27 May 2014 15:49:53 +0000 (17:49 +0200)
committerMichael Vogt <mvo@debian.org>
Tue, 27 May 2014 15:49:53 +0000 (17:49 +0200)
Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer()

Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
apt-pkg/depcache.cc

index 19a6e0d..aa96ac5 100644 (file)
@@ -1678,7 +1678,7 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk
 {
    /* Not source/not automatic versions cannot be a candidate version 
       unless they are already installed */
-   VerIterator Last(*(pkgCache *)this,0);
+   VerIterator Last;
    
    for (VerIterator I = Pkg.VersionList(); I.end() == false; ++I)
    {