summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-03-19 01:56:38 +0100
committerJulian Andres Klode <jak@debian.org>2016-03-19 07:19:24 +0100
commitf40fdaa43271edf98b80c08e20f401b5da591501 (patch)
tree11fc9ad9daaf7ba0223688fcff90a5332e1916b6 /apt-pkg/pkgcache.cc
parent03bcd80f2680f0f52902665f4efe7ac83fd2aef0 (diff)
cachefile: Only set members that were initialized successfully
Otherwise, things will just start failing later down the stack, because (a) the lazy getters do not check if building was successful and (b) any further getter call would return the invalid object anyway. Also initialize VS in pkgCache to nullptr by default. Closes: #818628
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 159b5e00e..83cb6149e 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -127,7 +127,7 @@ bool pkgCache::Header::CheckSizes(Header &Against) const
// ---------------------------------------------------------------------
/* */
APT_IGNORE_DEPRECATED_PUSH
-pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), d(NULL)
+pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), VS(nullptr), d(NULL)
{
// call getArchitectures() with cached=false to ensure that the
// architectures cache is re-evaulated. this is needed in cases