From cba5c5a26a9bf00724f8ea647ac61b30e32734ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 14 Aug 2017 10:36:55 +0200 Subject: 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 --- apt-pkg/aptconfiguration.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') 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 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 || -- cgit v1.2.3