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

Adds a test to ensure that patched_versions has an open ended upper l… #302

Merged
merged 3 commits into from
Jan 9, 2018

Conversation

errm
Copy link
Contributor

@errm errm commented Sep 20, 2017

…imit

Fixes #285

Copy link
Member

@postmodern postmodern left a comment

Choose a reason for hiding this comment

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

I like the idea, but the spec needs improvement. Also I think you messed up that first patched_versions change.


# If a gem is unpatched this test makes no sense
unless patched_versions.none?
expect(versions.any? { |version| version.match(/^>=|^>/)}).to be_truthy
Copy link
Member

Choose a reason for hiding this comment

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

There may be advisories where multiple version families were patched. Thus the last version family would probably be >= .... Example:

patched_versions:
  - "~> 1.0.1"
  - "~> 1.1.5"
  - "~> 1.2.9"
  - ">= 1.3.0"

I think a better test would be to ensure that the last patched_versions element is always open-ended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I ended up having to sort the versions that the conditions applied to in order to make this work because the order is not consistent...

@@ -14,3 +14,5 @@ description: |
cvss_v2: 7.5
unaffected_versions:
- "< 0.7.0"
patched_versions:
- ">= 0.9.13"
Copy link
Member

Choose a reason for hiding this comment

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

According to the original advisory, 0.9.14 contains the patch. https://groups.google.com/forum/?fromgroups=#!topic/dragonfly-users/3c3WIU3VQTo

@errm
Copy link
Contributor Author

errm commented Nov 16, 2017

Hopefully this should do the trick PTAL @postmodern

@errm errm force-pushed the errm/open-ended-upper-limit branch from 47f4629 to e6bdeb0 Compare January 8, 2018 16:33
@errm
Copy link
Contributor Author

errm commented Jan 8, 2018

Bump ...

@mveytsman
Copy link
Member

Judging by #318 and #319 this is sorely needed!

@mveytsman
Copy link
Member

LGTM (and would have caught the Rubocop issue above)

@postmodern I believe this addresses your concerns.

@postmodern postmodern merged commit 40ecb3d into rubysec:master Jan 9, 2018
@errm errm deleted the errm/open-ended-upper-limit branch January 9, 2018 08:48
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.

3 participants