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

Improve CPE parsing #915

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Improve CPE parsing #915

merged 2 commits into from
Nov 3, 2023

Conversation

bjoernricks
Copy link
Contributor

What

Improve parsing of CPEs

Why

It wasn't possible to parse a CPE like cpe:2.3:a:foo\:bar:baz:... where the vendor is foo:bar. Additionally it wasn't easy to spot where the parsing did go wrong.

Checklist

  • Tests

Raise a descriptive error message during converting a CPE to the URI
format (CPE v2.2) if transforming a part of the CPE fails.
@bjoernricks bjoernricks requested a review from a team as a code owner November 3, 2023 07:47
@bjoernricks bjoernricks enabled auto-merge (rebase) November 3, 2023 07:47
Copy link

github-actions bot commented Nov 3, 2023

Conventional Commits Report

Type Number
Added 2

🚀 Conventional commits found.

In the real world CPEs contain escaped colons in the vendor or product
parts exist. Therefore allow to parse these CPE strings. Currently
parsing a CPE string like `cpe:2.3:a:foo\\:bar:...` wouldn't work. But
as far as I can see this is neither a valid CPE nor a real world
scenario.
@bjoernricks bjoernricks merged commit 872f7cd into main Nov 3, 2023
19 of 20 checks passed
@bjoernricks bjoernricks deleted the cpe-parsing branch November 3, 2023 09:21
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 this pull request may close these issues.

2 participants