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

Nil ptr deref panic when parsing JSON SBOM with a null relationships value #238

Closed
nchelluri opened this issue Apr 25, 2024 · 2 comments · Fixed by #239
Closed

Nil ptr deref panic when parsing JSON SBOM with a null relationships value #238

nchelluri opened this issue Apr 25, 2024 · 2 comments · Fixed by #239

Comments

@nchelluri
Copy link

If I try to parse spdx-null-rel.json - a JSON SBOM containing a null value in the relationships array, then I get a panic. I am using tools-golang v0.5.4.

@kzantow
Copy link
Collaborator

kzantow commented Apr 26, 2024

Hi @nchelluri I would just note that this does not look like it's a valid SPDX document -- instead of the required object, it has a null value for a relationship entry (rather than a null relationships array):

"relationships": [
  null
],

That said, the library shouldn't panic. Thanks for reporting!

@nchelluri
Copy link
Author

I definitely agree that the null value is invalid. I just happened to accidentally hack up an SBOM file in such a way that this happened. I was just testing some stuff out. (My main aim here is to say I am not writing an SBOM generator that generates invalid SPDX SBOMs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants