From 06a8e0dcb37796136be983b247c5d1bbfdf47a2e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 6 Mar 2016 14:44:06 +0100 Subject: get group again after potential remap in Source: parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mysteriously segfaults only on i386 for me, but at least one reporter had the same behavior and it makes sense that this is the problem as the parsing of Source: was fixed in 1.2.2 – before the not remapped group was not used. We don't use our usual Dynamic<> trick here as we don't have it in the parser. Its a bit of a layer violation to do this parsing here, but its how it is always was… Until next time with this lovely kind of problem. Closes: 812251 Thanks: Francesco Poli and Marc Haber for testdata. --- apt-pkg/deb/deblistparser.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 860aa3bc2..ed5484ad9 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -144,7 +144,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) Ver->Section = idx; } // Parse the source package name - pkgCache::GrpIterator const G = Ver.ParentPkg().Group(); + pkgCache::GrpIterator G = Ver.ParentPkg().Group(); Ver->SourcePkgName = G->Name; Ver->SourceVerStr = Ver->VerStr; if (Section.Find("Source",Start,Stop) == true) @@ -164,6 +164,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) if (version != Ver.VerStr()) { map_stringitem_t const idx = StoreString(pkgCacheGenerator::VERSIONNUMBER, version); + G = Ver.ParentPkg().Group(); Ver->SourceVerStr = idx; } } @@ -190,6 +191,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) if (V.end() == true) { map_stringitem_t const idx = StoreString(pkgCacheGenerator::PKGNAME, pkgname); + G = Ver.ParentPkg().Group(); Ver->SourcePkgName = idx; } } -- cgit v1.2.3