diff options
author | David Kalnischkies <david@kalnischkies.de> | 2017-08-14 10:36:55 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2017-09-09 17:22:00 +0200 |
commit | cba5c5a26a9bf00724f8ea647ac61b30e32734ba (patch) | |
tree | a578bf9b4c5ea5b7b96eb79f10a0efa91a102082 | |
parent | 8130f39cf085efcf34bee9e9ce89802b29bb9318 (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
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 405472a72..0421ea949 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 || |