summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/fileutl.cc7
-rw-r--r--debian/changelog7
-rw-r--r--methods/mirror.cc3
3 files changed, 15 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index f18e17005..46661887a 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1424,8 +1424,11 @@ bool FileFd::Seek(unsigned long long To)
return _error->Error("Reopen is only implemented for read-only files!");
}
#ifdef HAVE_BZ2
- if (d->bz2 != NULL)
- BZ2_bzclose(d->bz2);
+ if (d->bz2 != NULL)
+ {
+ BZ2_bzclose(d->bz2);
+ d->bz2 = NULL;
+ }
#endif
if (iFd != -1)
close(iFd);
diff --git a/debian/changelog b/debian/changelog
index b3800fc42..7d22ba396 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,13 @@ apt (0.9.8.2) UNRELEASED; urgency=low
[ Michael Vogt ]
* buildlib/apti18n.h.in:
- fix build failure when building without NLS (closes: #671587)
+
+ [ Gregoire Menuel ]
+ * Fix double free (closes: #711045)
+
+ [ Raphael Geissert ]
+ * Fix crash when the "mirror" method does not find any entry
+ (closes: #699303)
[ Johan Kiviniemi ]
* cmdline/apt-key:
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;