From: David Kalnischkies Date: Sun, 6 Mar 2016 13:44:06 +0000 (+0100) Subject: get group again after potential remap in Source: parse X-Git-Tag: 1.2.5~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/06a8e0dcb37796136be983b247c5d1bbfdf47a2e get group again after potential remap in Source: parse 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. --- 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; } }