summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2019-08-15 09:03:45 +0000
committerJulian Andres Klode <jak@debian.org>2019-08-15 09:03:45 +0000
commit7c724251fd8c24e89dc8cb813eee20aa0a4ad793 (patch)
tree2133fef8b26c5ec30b3c8525eab3ae902007607e /apt-pkg
parented4a8421e4d51c19a4aa1bd5e91370ba8bc8efca (diff)
parent56820d4c244e896a62f57ff96801dc1283b8b0e2 (diff)
Merge branch 'master' into 'master'
Fix segfault in pkgAcquire::Enqueue() with Acquire::Queue-Mode=access See merge request apt-team/apt!73
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 6cf8b4c83..776c82b3b 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -307,7 +307,7 @@ static bool CheckForBadItemAndFailIt(pkgAcquire::Item * const Item,
void pkgAcquire::Enqueue(ItemDesc &Item)
{
// Determine which queue to put the item in
- const MethodConfig *Config;
+ const MethodConfig *Config = nullptr;
string Name = QueueName(Item.URI,Config);
if (Name.empty() == true)
{
@@ -387,14 +387,16 @@ string pkgAcquire::QueueName(string Uri,MethodConfig const *&Config)
{
constexpr int DEFAULT_HOST_LIMIT = 10;
URI U(Uri);
- // Access mode forces all methods to be Single-Instance
- if (QueueMode == QueueAccess)
- return U.Access;
+ // Note that this gets written through the reference to the caller.
Config = GetConfig(U.Access);
if (Config == nullptr)
return {};
+ // Access mode forces all methods to be Single-Instance
+ if (QueueMode == QueueAccess)
+ return U.Access;
+
// Single-Instance methods get exactly one queue per URI
if (Config->SingleInstance == true)
return U.Access;