-
Notifications
You must be signed in to change notification settings - Fork 531
Add Affected versions list when no range is available #5047
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
base: main
Are you sure you want to change the base?
Add Affected versions list when no range is available #5047
Conversation
e9b43ca
to
0a5b1fe
Compare
Seems like a fairly straightforward fix. Did you test this on your local @merlin-sievers ? |
Yes, WorksOnMyMachine™ @joydeep049 |
Then we can consider merging this @terriko @mastersans |
Hi @merlin-sievers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! It sounds useful.
Looks like our linters are complaining about some whitespace stuff:
cve_bin_tool/cve_scanner.py:146:67: E231 missing whitespace after ','
cve_bin_tool/cve_scanner.py:146:70: E231 missing whitespace after ','
cve_bin_tool/cve_scanner.py:146:73: E231 missing whitespace after ','
I did a quick "suggestion" that should fix those ones, but you probably should just run black
on the changed files in case it's got anything else it's being picky about. There's more on our linters here if you've never used these before: https://github.com/intel/cve-bin-tool/blob/main/CONTRIBUTING.md#running-linters
""" | ||
self.cursor.execute(query, [cve_number]) | ||
affected_versions = list(set(map(lambda x: x[0], self.cursor.fetchall()))) | ||
self.all_cve_version_info[cve_number] = VersionInfo('','','','', affected_versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.all_cve_version_info[cve_number] = VersionInfo('','','','', affected_versions) | |
self.all_cve_version_info[cve_number] = VersionInfo('', '', '', '', affected_versions) |
Oh, sorry I missed the linters. |
There's an error related to commit message in your PR. It does not follow the conventional commit structure. |
In cases where no range of affected versions is available (usually denoted as "-" due to the missing start and end point of the version range), a list of affected versions, which is usually available, is printed instead (still only when supplying the
--affected-versions
option).This is useful when trying to automatically find the next recent version that is not affected while no affected version range is available.