Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update parsing logic to remove empty space #2273

Merged
merged 3 commits into from Oct 31, 2023
Merged

Conversation

spiffcs
Copy link
Contributor

@spiffcs spiffcs commented Oct 30, 2023

Summary

While we wait for clarity on #2029 this PR submits a small fix for the following issues:

A user submitted a valid *.dll where ProductName was the correct package name. This PR keeps the current behavior while falling back to ProductName. It also adds a check so that name or version can no longer be " ".

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs spiffcs requested a review from a team October 30, 2023 23:07
Copy link
Contributor

@willmurphyscode willmurphyscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it was a subtle bug. Is it possible to get this behavior under unit test so that we don't re-introduce the bug?

Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but agree with @willmurphyscode about adding a basic test for this case somehow

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs
Copy link
Contributor Author

spiffcs commented Oct 31, 2023

@kzantow @willmurphyscode I redid my initial cases with the ones provided by the community in the two issues linked to this PR. I don't think it's perfect, and the full solution will come from #2029, but this should get us generating valid SBOMS in more instances where these edge cases pop up around the metadata

@spiffcs spiffcs added the bug Something isn't working label Oct 31, 2023
@spiffcs spiffcs merged commit 9d4b57b into main Oct 31, 2023
10 checks passed
@spiffcs spiffcs deleted the 2241-dotnet-parsing-bug branch October 31, 2023 14:43
wagoodman pushed a commit that referenced this pull request Oct 31, 2023
* fix: update parsing logic to remove empty space
* tests: update with test cases provided by community
---------
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
…re#2273)

* fix: update parsing logic to remove empty space
* tests: update with test cases provided by community
---------
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET / nuget - invalid SBOM generated after parsing Wrong parsing after v0.85.0 syft for some components
3 participants