Browse Source

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.
tags/debian/1.2.5
David Kalnischkies David Kalnischkies 5 years ago
parent
commit
06a8e0dcb3
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      apt-pkg/deb/deblistparser.cc

+ 3
- 1
apt-pkg/deb/deblistparser.cc View File

@@ -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;
}
}


Loading…
Cancel
Save