fix(debian): bound the decompressed members of a .deb archive (#5293)

This commit is contained in:
Alex Goodman
2026-09-14 18:17:56 -04:00
committed by GitHub
parent 2be26a1af9
commit b4ee6e4696
7 changed files with 498 additions and 23 deletions
+10 -2
View File
@@ -202,7 +202,11 @@ func getAdditionalFileListing(resolver file.Resolver, dbLocation file.Location,
if md5Reader != nil && md5Location != nil {
defer internal.CloseAndLogError(md5Reader, md5Location.AccessPath)
// attach the file list
files = append(files, parseDpkgMD5Info(md5Reader)...)
records, err := parseDpkgMD5Info(md5Reader)
if err != nil {
log.Debugf("dpkg md5sums file %q: %v", md5Location.RealPath, err)
}
files = append(files, records...)
// keep a record of the file where this was discovered
locations = append(locations, *md5Location)
@@ -213,7 +217,11 @@ func getAdditionalFileListing(resolver file.Resolver, dbLocation file.Location,
if conffilesReader != nil && conffilesLocation != nil {
defer internal.CloseAndLogError(conffilesReader, conffilesLocation.AccessPath)
// attach the file list
files = append(files, parseDpkgConffileInfo(conffilesReader)...)
records, err := parseDpkgConffileInfo(conffilesReader)
if err != nil {
log.Debugf("dpkg conffiles file %q: %v", conffilesLocation.RealPath, err)
}
files = append(files, records...)
// keep a record of the file where this was discovered
locations = append(locations, *conffilesLocation)