mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
Prevent invalid CPE field values (#514)
* Fix CPE set comparison mismatch Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add failing test to assert CPE generation excludes URLs Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Add removeByCondition method to fieldCandidateSet Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Prevent invalid CPE values for products and vendors Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Introduce removeWhere and rename filter to condition Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Refactor fieldCandidateSet and condition logic Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Move CPE parsing filter to end of CPE generation Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
@@ -46,7 +46,7 @@ func candidateProductsForJava(p pkg.Package) []string {
|
||||
func candidateVendorsForJava(p pkg.Package) fieldCandidateSet {
|
||||
gidVendors := vendorsFromGroupIDs(groupIDsFromJavaPackage(p))
|
||||
nameVendors := vendorsFromJavaManifestNames(p)
|
||||
return newFieldCandidateFromSets(gidVendors, nameVendors)
|
||||
return newFieldCandidateSetFromSets(gidVendors, nameVendors)
|
||||
}
|
||||
|
||||
func vendorsFromJavaManifestNames(p pkg.Package) fieldCandidateSet {
|
||||
|
||||
Reference in New Issue
Block a user