ext/featurefmt/apk: handle malformed packages
This commit is contained in:
parent
590e7e2602
commit
b2f2b2c854
@ -66,6 +66,10 @@ func (l lister) ListFeatures(files tarutil.FilesMap) ([]database.FeatureVersion,
|
||||
} else {
|
||||
ipkg.Version = version
|
||||
}
|
||||
case line == "":
|
||||
// Restart if the parser reaches another package definition before
|
||||
// creating a valid package.
|
||||
ipkg = database.FeatureVersion{}
|
||||
}
|
||||
|
||||
// If we have a whole feature, store it in the set and try to parse a new
|
||||
|
2
ext/featurefmt/apk/testdata/installed
vendored
2
ext/featurefmt/apk/testdata/installed
vendored
@ -20,6 +20,8 @@ R:ld-musl-x86_64.so.1
|
||||
a:0:0:755
|
||||
Z:Q1KUwsFGLHn/enpN9+QIpK/FmixtQ=
|
||||
|
||||
P:invalidPackageWithoutAVersion
|
||||
|
||||
C:Q1yhJHGSZ80L7cL0y4UKKGrBPwrUQ=
|
||||
P:busybox
|
||||
V:1.24.2-r9
|
||||
|
Loading…
Reference in New Issue
Block a user