From a7a2824bad5fd9c868f4774771ec9fb2f1895285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=BCnther?= Date: Sun, 30 May 2010 20:44:11 +0200 Subject: apt-pkg/deb/dpkgpm.cc: Fix segmentation fault when /var/log/apt ist missing. LP: #535509 --- apt-pkg/deb/dpkgpm.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 18c731788..036f0e385 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -653,6 +653,11 @@ bool pkgDPkgPM::CloseLog() } term_out = NULL; + // check if the directory exists in which we want to write the file + string const logdir = _config->FindDir("Dir::Log"); + if(not FileExists(logdir)) + return _error->Error(_("Directory '%s' missing"), logdir.c_str()); + string history_name = flCombine(_config->FindDir("Dir::Log"), _config->Find("Dir::Log::History")); if (!history_name.empty()) -- cgit v1.2.3