Skip to content

Commit 04af59c

Browse files
authored
fix(sbom): don't overwrite srcEpoch when decoding SBOM files (#6866)
1 parent bb26445 commit 04af59c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/sbom/io/decode.go

+5
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ func (m *Decoder) fillSrcPkg(c *core.Component, pkg *ftypes.Package) {
271271
}
272272
m.parseSrcVersion(pkg, c.SrcVersion)
273273

274+
// Source info was added from component or properties
275+
if pkg.SrcName != "" && pkg.SrcVersion != "" {
276+
return
277+
}
278+
274279
// Fill source package information for components in third-party SBOMs .
275280
if pkg.SrcName == "" {
276281
pkg.SrcName = pkg.Name

0 commit comments

Comments
 (0)