From: Michael Vogt Date: Tue, 27 May 2014 15:49:53 +0000 (+0200) Subject: Do not try to cast a pkgDepCache::Policy to a pkgCache X-Git-Tag: 1.0.4~24^2~3 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/de6221c9d5f99a276628bcf45fb28537e46e7660 Do not try to cast a pkgDepCache::Policy to a pkgCache Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer --- diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 19a6e0d7e..aa96ac58f 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -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) {