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

* apt-pkg/deb/dpkgpm.cc:
- fix segfault if dpkg sends multiline error messages

Michael Vogt лет назад: 19
Родитель
Сommit
ed94a0d6f6
3 измененных файлов с 22 добавлено и 8 удалено
  1. 12 7
      apt-pkg/deb/dpkgpm.cc
  2. 1 1
      configure.in
  3. 9 0
      debian/changelog

+ 12 - 7
apt-pkg/deb/dpkgpm.cc

@@ -624,15 +624,20 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 	    
 	 */
 	 char* list[5];
-	 if(!TokSplitString(':', line, list, sizeof(list)/sizeof(list[0])))
-	    // FIXME: dpkg sends multiline error messages sometimes (see
-	    //        #374195 for a example. we should support this by
-	    //        either patching dpkg to not send multiline over the
-	    //        statusfd or by rewriting the code here to deal with
-	    //        it. for now we just ignore it and not crash
-	    continue;
+	 //        dpkg sends multiline error messages sometimes (see
+	 //        #374195 for a example. we should support this by
+	 //        either patching dpkg to not send multiline over the
+	 //        statusfd or by rewriting the code here to deal with
+	 //        it. for now we just ignore it and not crash
+	 TokSplitString(':', line, list, sizeof(list)/sizeof(list[0]));
 	 char *pkg = list[1];
 	 char *action = _strstrip(list[2]);
+	 if( pkg == NULL || action == NULL) 
+	 {
+	    if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+	       std::clog << "ignoring line: not enough ':'" << std::endl;
+	    continue;
+	 }
 
 	 if(strncmp(action,"error",strlen("error")) == 0)
 	 {

+ 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)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.46.3")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)

+ 9 - 0
debian/changelog

@@ -1,3 +1,11 @@
+apt (0.6.46.3) unstable; urgency=low
+
+  * apt-pkg/deb/dpkgpm.cc:
+    - make progress reporting robust against multiline error
+      messages 
+
+ --
+
 apt (0.6.46.2) unstable; urgency=low
 
   * Merged from Christian Perrier bzr branch:
@@ -6,6 +14,7 @@ apt (0.6.46.2) unstable; urgency=low
     - cs.po: Updated. Closes: #391064
     - es.po: Updated to 514t. Closes: #391661
     - da.po: Updated to 514t. Closes: #391424
+  
  -- Michael Vogt <mvo@debian.org>  Wed, 11 Oct 2006 09:03:15 +0200
 
 apt (0.6.46.1) unstable; urgency=low