cdxgen
cdxgen copied to clipboard
[cargo]: Incorrect version number parsing in cargo.toml
Case
[dependencies]
serde_json = { version = "1.0.128" }
Issue Description
In the provided cargo.toml file, the version number for the dependency serde_json is specified as 1.0.128 }
We introduced a toml library quite late to the project, so there is a lot of code that is parsing the toml files manually.
https://github.com/CycloneDX/cdxgen/blob/cd77efae086446ff4a3b92cf35b88de2be828d36/lib/helpers/utils.js#L7465
I think it is a good idea to refactor all cargo parsing methods to use toml library. Would you be interested in contributing a PR?
@prabhu Thank you for the invitation, this is indeed a good idea. I will try to complete it, and if I can do it well, I will submit a PR.