From e04bed5109af34a6f14179b3b45b4a8352548d1a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 25 Oct 2017 21:42:43 +0200 Subject: Don't segfault if receiving a method warning on empty queue We would like to issue a warning about seccomp support in Configuration(), but since the queue is empty, there is no current item to show the URL for and we get a segfault. Show the protocol instead. --- apt-pkg/acquire-worker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 49d67e370..39158aed7 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -327,7 +327,7 @@ bool pkgAcquire::Worker::RunMessages() } case MessageType::WARNING: - _error->Warning("%s: %s", Itm->Owner->DescURI().c_str(), LookupTag(Message,"Message").c_str()); + _error->Warning("%s: %s", Itm ? Itm->Owner ? Itm->Owner->DescURI().c_str() : Access.c_str() : Access.c_str(), LookupTag(Message, "Message").c_str()); break; case MessageType::URI_START: -- cgit v1.2.3