summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
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:23:40 +0200
commit0cd8081f55a958ef34b51855b16157412bc188a6 (patch)
tree02449a9c15da3499c958f5d87feb20c0f4a3eec8 /apt-pkg/aptconfiguration.cc
parentcd53fa0b7ca23ba3e6aa79d858706cf00bd357b6 (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/aptconfiguration.cc')
-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 01ae5a642..0fb61c928 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -323,7 +323,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 ||