From: Michael Vogt Date: Tue, 7 Apr 2015 10:20:56 +0000 (+0200) Subject: fix crash in order writing in pkgDPkgPM::WriteApportReport() X-Git-Tag: 1.0.9.8~3 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/3af3768e1a0ae8519ac85fbe1eb4494eeb076fa2?ds=sidebyside;hp=66c3875df391b1120b43831efcbe88a78569fbfe fix crash in order writing in pkgDPkgPM::WriteApportReport() libapt can be configured to write various bits of information to a file creating a report via apport. This is disabled by default in Debian and apport residing only in /experimental so far, but Ubuntu and other derivatives have this (in some versions) enabled by default and there is no regression potentially here. The crash is caused by a mismatch of operations vs. strings for operations, so adding the missing strings for these operations solves the problem. [commit message by David Kalnischkies] LP: #1436626 --- diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index e23ca466d..82e045fd3 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1900,8 +1900,15 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) } } - // log the ordering - const char *ops_str[] = {"Install", "Configure","Remove","Purge"}; + // log the ordering, see dpkgpm.h and the "Ops" enum there + const char *ops_str[] = { + "Install", + "Configure", + "Remove", + "Purge", + "ConfigurePending", + "TriggersPending", + }; fprintf(report, "AptOrdering:\n"); for (vector::iterator I = List.begin(); I != List.end(); ++I) if ((*I).Pkg != NULL)