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: check return on re.search #1643

Merged
merged 1 commit into from
Apr 26, 2022
Merged

fix: check return on re.search #1643

merged 1 commit into from
Apr 26, 2022

Conversation

wyattearp
Copy link
Contributor

addresses #1639

re.search returns None on failure, updating to indicate the version is
UNKNOWN when this occurs and generating a log message

I noted as well that there are other places in the code where this is unchecked, but it doesn't look like they could normally fail, but this should specifically fix #1639.

Checklist

  • Have I run the tests locally on at least one version of Python? - the number of tests that pass before and after this change are the same. No additional warnings are generated.
  • Have I run the code linters and fixed any issues they found?
  • Have I added any tests I need to prove that my code works? - N/A I am unable to provide the binary that causes this defect at this time.
  • Have I used Conventional Commits to format the title of my pull request?
  • If I closed a bug, have I linked it using one of [GitHub's keywords]
    Have I checked on the results from GitHub Actions?

Please feel free to make any recommendations / suggestions for improvement as this is my first PR to your project.

addresses intel#1639

re.search returns `None` on failure, updating to indicate the version is
`UNKNOWN` when this occurs and generating a log message
@codecov-commenter
Copy link

Codecov Report

Merging #1643 (1b3995a) into main (abffa0d) will decrease coverage by 0.20%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main    #1643      +/-   ##
==========================================
- Coverage   78.44%   78.24%   -0.21%     
==========================================
  Files         291      291              
  Lines        6009     6012       +3     
  Branches      986      987       +1     
==========================================
- Hits         4714     4704      -10     
- Misses       1081     1092      +11     
- Partials      214      216       +2     
Flag Coverage Δ
longtests 78.24% <25.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cve_bin_tool/cve_scanner.py 83.33% <25.00%> (-1.78%) ⬇️
cve_bin_tool/nvd_api.py 75.00% <0.00%> (-9.49%) ⬇️
cve_bin_tool/cli.py 70.43% <0.00%> (+0.43%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

Thank you!

@terriko terriko merged commit ec69e35 into intel:main Apr 26, 2022
@wyattearp wyattearp deleted the fix-1639 branch April 27, 2022 01:43
anthonyharrison pushed a commit to anthonyharrison/cve-bin-tool that referenced this pull request May 2, 2022
addresses intel#1639

re.search returns `None` on failure, updating to indicate the version is
`UNKNOWN` when this occurs and generating a log message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants