Просмотр исходного кода

* apt-pkg/acquire-item.cc:
- do not segfault on invalid items (closes: #544080)

Michael Vogt лет назад: 17
Родитель
Сommit
6abe26994f
4 измененных файлов с 16 добавлено и 16 удалено
  1. 0 2
      .bzr-builddeb/default.conf.orig
  2. 13 13
      apt-pkg/acquire-item.cc
  3. 1 1
      configure.in
  4. 2 0
      debian/changelog

+ 0 - 2
.bzr-builddeb/default.conf.orig

@@ -1,2 +0,0 @@
-[BUILDDEB]
-native = true

+ 13 - 13
apt-pkg/acquire-item.cc

@@ -596,21 +596,21 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)	/*{{{*/
       if(Desc.URI.substr(nameLen) != *t)
       if(Desc.URI.substr(nameLen) != *t)
 	 continue;
 	 continue;
 
 
-      // we want to try it with the next extension
+      // we want to try it with the next extension (and make sure to 
+      // not skip over the end)
       t++;
       t++;
+      if (t == types.end())
+	 break;
 
 
-      if (t != types.end())
-      {
-	 Desc.URI = Desc.URI.substr(0, nameLen) + *t;
-
-	 new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc,
-			 ExpectedHash, string(".").append(*t));
-
-	 Status = StatDone;
-	 Complete = false;
-	 Dequeue();
-	 return;
-      }
+      // queue new download
+      Desc.URI = Desc.URI.substr(0, nameLen) + *t;
+      new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc,
+      ExpectedHash, string(".").append(*t));
+      
+      Status = StatDone;
+      Complete = false;
+      Dequeue();
+      return;
    }
    }
 
 
    // on decompression failure, remove bad versions in partial/
    // on decompression failure, remove bad versions in partial/

+ 1 - 1
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 
 dnl -- SET THIS TO THE RELEASE VERSION --
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.7.22.3")
+AC_DEFINE_UNQUOTED(VERSION,"0.7.23.1")
 PACKAGE="apt"
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE)

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ apt (0.7.23.1) UNRELEASED; urgency=low
       triggers-pending state. dpkg will deal with the trigger and
       triggers-pending state. dpkg will deal with the trigger and
       it if does it before we trigger it, dpkg will error out
       it if does it before we trigger it, dpkg will error out
       (LP: #414631)
       (LP: #414631)
+  * apt-pkg/acquire-item.cc:
+    - do not segfault on invalid items (closes: #544080)
 
 
  -- Michael Vogt <mvo@debian.org>  Fri, 28 Aug 2009 18:53:20 +0200
  -- Michael Vogt <mvo@debian.org>  Fri, 28 Aug 2009 18:53:20 +0200