Преглед изворни кода

Fix double free (closes: #711045)

* Fix double free (closes: #711045)

* Fix crash when the "mirror" method does not find any entry
  (closes: #699303)
Michael Vogt пре 13 година
родитељ
комит
245ba2c306
2 измењених фајлова са 8 додато и 1 уклоњено
  1. 5 1
      debian/changelog
  2. 3 0
      methods/mirror.cc

+ 5 - 1
debian/changelog

@@ -11,7 +11,11 @@ apt (0.9.8.2) UNRELEASED; urgency=low
     - fix build failure when building without NLS (closes: #671587)
   
   [ Gregoire Menuel ]
-  * fix double free (closes: #711045)
+  * Fix double free (closes: #711045)
+  
+  [ Raphael Geissert ]
+  * Fix crash when the "mirror" method does not find any entry
+    (closes: #699303)
 
  -- Christian Perrier <bubulle@debian.org>  Thu, 16 May 2013 22:28:22 +0200
 

+ 3 - 0
methods/mirror.cc

@@ -311,6 +311,9 @@ bool MirrorMethod::InitMirrors()
 
       AllMirrors.push_back(s);
    }
+   if (AllMirrors.empty()) {
+	return _error->Error(_("No entry found in mirror file '%s'"), MirrorFile.c_str());
+   }
    Mirror = AllMirrors[0];
    UsedMirror = Mirror;
    return true;