Parcourir la source

* be extra carefull in cmdline/apt-get.cc:FindSrc() and check VF.File() for NULL

Michael Vogt il y a 21 ans
Parent
commit
7049e4e9ca
2 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 5 1
      cmdline/apt-get.cc
  2. 2 0
      debian/changelog

+ 5 - 1
cmdline/apt-get.cc

@@ -1200,7 +1200,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
       VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end());
       VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end());
       TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash);
       TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash);
    } 
    } 
-   else  if(DefRel.empty() == false) 
+   else  if(DefRel.empty() == false)
    {
    {
       // we have a default release, try to locate the pkg. we do it like
       // we have a default release, try to locate the pkg. we do it like
       // this because GetCandidateVer() will not "downgrade", that means
       // this because GetCandidateVer() will not "downgrade", that means
@@ -1211,6 +1211,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
 	 for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false;
 	 for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false;
 	      VF++)
 	      VF++)
 	 {
 	 {
+	    // extra paranioa
+	    if(VF.File() == NULL)
+	       continue;
+
 	    /* If this is the status file, and the current version is not the
 	    /* If this is the status file, and the current version is not the
 	       version in the status file (ie it is not installed, or somesuch)
 	       version in the status file (ie it is not installed, or somesuch)
 	       then it is not a candidate for installation, ever. This weeds
 	       then it is not a candidate for installation, ever. This weeds

+ 2 - 0
debian/changelog

@@ -5,6 +5,8 @@ apt (0.6.42.1) unstable; urgency=low
   * apt-pkg/pkgrecords.cc:
   * apt-pkg/pkgrecords.cc:
     - revert patch from last version, it causes trouble on alpha 
     - revert patch from last version, it causes trouble on alpha 
       and ia64 (closes: #335102, #335103)
       and ia64 (closes: #335102, #335103)
+  * cmdline/apt-get.cc:
+    - be extra carefull in FindSrc (closes: #335213)
 
 
  -- Michael Vogt <mvo@debian.org>  Sat, 22 Oct 2005 23:44:35 +0200
  -- Michael Vogt <mvo@debian.org>  Sat, 22 Oct 2005 23:44:35 +0200