Преглед изворни кода

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.
Julian Andres Klode пре 11 година
родитељ
комит
44d9e9f91b
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      apt-private/private-show.cc

+ 1 - 1
apt-private/private-show.cc

@@ -94,7 +94,7 @@ static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
    if (is_installed)
    if (is_installed)
       manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no";
       manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no";
    else
    else
-      manual_installed = 0;
+      manual_installed = "";
 
 
    // FIXME: add verbose that does not do the removal of the tags?
    // FIXME: add verbose that does not do the removal of the tags?
    std::vector<pkgTagSection::Tag> RW;
    std::vector<pkgTagSection::Tag> RW;