Skip to content

Commit

Permalink
fix(cpe): fix cpe match false positive (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe committed Nov 16, 2018
1 parent abc105b commit 9549cd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions db/db.go
Expand Up @@ -105,6 +105,13 @@ func match(specified common.WellFormedName, cpe models.Cpe) (bool, error) {
if err != nil {
return false, err
}

if wfn.Get("part") != specified.Get("part") ||
wfn.Get("vendor") != specified.Get("vendor") ||
wfn.Get("product") != specified.Get("product") {
return false, nil
}

if matching.IsEqual(specified, wfn) {
log.Debugf("%s equals %s", specified.String(), cpe.URI)
return true, nil
Expand Down

0 comments on commit 9549cd3

Please sign in to comment.