summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-08-14 10:36:55 +0200
committerJulian Andres Klode <jak@debian.org>2017-09-13 18:14:12 +0200
commitccd6ebbc9ab4026a77ac2844e15ea35adfe788be (patch)
tree053f74e2fc21f31bb6596dad49c5f7deeb628e09 /apt-pkg
parent8d32cfbe25402f9d2cc0e858b408c4e873679380 (diff)
don't ask an uninit _system for supported archs
A libapt user who hasn't initialized _system likely has a reason, so we shouldn't greet back with a segfault usually deep down in the callstack for no reason. If the user had intended to pick up information from the system, _system wouldn't be uninitialized after all. LP: #1613184 SRU: 1.4.y (cherry picked from commit cba5c5a26a9bf00724f8ea647ac61b30e32734ba)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/aptconfiguration.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index 0035f70df..e16117b70 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -322,7 +322,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
string const arch = _config->Find("APT::Architecture");
archs = _config->FindVector("APT::Architectures");
- if (archs.empty() == true)
+ if (archs.empty() == true && _system != nullptr)
archs = _system->ArchitecturesSupported();
if (archs.empty() == true ||