From: Julian Andres Klode Date: Mon, 17 Aug 2015 08:10:57 +0000 (+0200) Subject: Do not crash in 'apt show' for non-installed packages X-Git-Tag: 1.1.exp9~9 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/44d9e9f91b6e87717844a7ec562bd38886a57aa6?ds=sidebyside Do not crash in 'apt show' for non-installed packages For a non-installed package, manual_installed was set to the null pointer. This was passed to Tag::Rewrite, which expects an string (empty for null-type values) and the conversion from null pointer to string does not work correctly. --- diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 790bc0092..3a393b746 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -94,7 +94,7 @@ static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V, if (is_installed) manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no"; else - manual_installed = 0; + manual_installed = ""; // FIXME: add verbose that does not do the removal of the tags? std::vector RW;