Skip to content

Release v0.2.390

Compare
Choose a tag to compare
@github-actions github-actions released this 04 Sep 09:13
· 11 commits to main since this release
9cfda3e

This pull request improves the robustness of the toLayers function in pkg/sbommanager/v1/source.go by handling cases where the ms slice is shorter than the ds slice or is nil, and adds comprehensive unit tests to verify its behavior.

Improved error handling and robustness

  • Updated the toLayers function to check that the ms slice has enough elements before accessing it, preventing potential out-of-bounds errors when ms is shorter than ds or is nil. ([pkg/sbommanager/v1/source.goL165-R169](diffhunk://#diff-e8fbb3cdbbd84fec27ef49bdf1428f8cbea3bfe05009801a5bbfd1178292df30L165-R169))

Test coverage

  • Added a new test suite in pkg/sbommanager/v1/source_test.go for the toLayers function, covering cases with empty, nil, and mismatched layer size slices to ensure correct behavior and edge case handling. ([pkg/sbommanager/v1/source_test.goR1-R95](diffhunk://#diff-7e704476132c470486ae4022b5c856ff856caf61311bd87e6dc1bfb3e58dd8f1R1-R95))