瀏覽代碼

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)
       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<pkgTagSection::Tag> RW;