Skip to content

Commit 5790b6f

Browse files
authored
fix(nvd): repo from commit in refs different from CPE cache resulting in failed conversion (#4770)
CVE-2026-23522 has a different repository in its CPE cache than in the commit extracted from references, causing a weird bug where it considers it a failed conversion.
1 parent 6860979 commit 5790b6f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

vulnfeeds/conversion/nvd/converter.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ func CVEToOSV(cve models.NVDCVE, repos []string, cache *git.RepoTagsCache, direc
5757
return fmt.Errorf("failed to convert version tags to commits: %+v %w", versions, err)
5858
}
5959
hasAnyFixedCommits := false
60-
for _, repo := range repos {
61-
if versions.HasFixedCommits(repo) {
60+
for _, ac := range versions.AffectedCommits {
61+
if ac.Fixed != "" {
6262
hasAnyFixedCommits = true
6363
break
6464
}
@@ -70,8 +70,8 @@ func CVEToOSV(cve models.NVDCVE, repos []string, cache *git.RepoTagsCache, direc
7070
}
7171

7272
hasAnyLastAffectedCommits := false
73-
for _, repo := range repos {
74-
if versions.HasLastAffectedCommits(repo) {
73+
for _, ac := range versions.AffectedCommits {
74+
if ac.LastAffected != "" {
7575
hasAnyLastAffectedCommits = true
7676
break
7777
}

0 commit comments

Comments
 (0)