From: Michael Vogt Date: Thu, 6 Jun 2013 16:20:35 +0000 (+0200) Subject: Fix double free (closes: #711045) X-Git-Tag: 0.9.9~12 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/245ba2c306e663fb311b7796fdf13a7ae7073a4d?hp=-c Fix double free (closes: #711045) * Fix double free (closes: #711045) * Fix crash when the "mirror" method does not find any entry (closes: #699303) --- 245ba2c306e663fb311b7796fdf13a7ae7073a4d diff --git a/debian/changelog b/debian/changelog index f0eb0421d..e31070aec 100644 --- a/debian/changelog +++ b/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 Thu, 16 May 2013 22:28:22 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index d6c5ba955..854366318 100644 --- a/methods/mirror.cc +++ b/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;