summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMatthias Günther <matgnt@gmail.com>2010-05-30 20:44:11 +0200
committerMatthias Günther <matgnt@gmail.com>2010-05-30 20:44:11 +0200
commita7a2824bad5fd9c868f4774771ec9fb2f1895285 (patch)
tree27bd2ba66b12169261b1fefb514075d6bdfe1502 /apt-pkg/deb
parente9deb44823c85daa7bb8e485610c0fad94f4be2c (diff)
apt-pkg/deb/dpkgpm.cc: Fix segmentation fault when /var/log/apt ist missing.
LP: #535509
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/dpkgpm.cc5
1 files changed, 5 insertions, 0 deletions
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())