mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 08:56:41 +01:00
Fix: make failed CPE validation correctly return error (#2762)
* Test CPE attributes correctly returns error Previously, this method incorrectly return an empty Attributes object and a nil error, leading to callers attempting to use the empty attributes object. Signed-off-by: Will Murphy <will.murphy@anchore.com> * chore: merge with main and refactor call that relied on old nil behavior Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> * test: add test to cover new OSCPE err pattern Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> --------- Signed-off-by: Will Murphy <will.murphy@anchore.com> Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
co-authored by
Christopher Phillips
parent
32c0d1e673
commit
770fdc53ea
@@ -381,7 +381,7 @@ func TestCatalog_MergeRecords(t *testing.T) {
|
||||
Type: RpmPkg,
|
||||
},
|
||||
{
|
||||
CPEs: []cpe.CPE{cpe.Must("cpe:2.3:b:package:1:1:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource)},
|
||||
CPEs: []cpe.CPE{cpe.Must("cpe:2.3:a:package:2:2:*:*:*:*:*:*:*", cpe.NVDDictionaryLookupSource)},
|
||||
Locations: file.NewLocationSet(
|
||||
file.NewVirtualLocationFromCoordinates(
|
||||
file.Coordinates{
|
||||
|
||||
Reference in New Issue
Block a user