ext/featurefmt/apk: handle malformed packages

This commit is contained in:
Jimmy Zelinskie 2017-04-11 15:48:11 -04:00
parent 590e7e2602
commit b2f2b2c854
2 changed files with 6 additions and 0 deletions

View File

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

View File

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