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: don't panic if openSSH version cannot be parsed #514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Mar 3, 2025

Branched off of #496

Addresses #496 (comment)

@G-Rath G-Rath marked this pull request as ready for review March 10, 2025 18:31
@@ -69,6 +69,16 @@ func (Detector) Requirements() *plugin.Capabilities {
// RequiredExtractors returns an empty list as there are no dependencies.
func (Detector) RequiredExtractors() []string { return []string{} }

func isVersionWithinRange(openSSHVersion string, lower string, upper string) (bool, error) {
isWithinRange, err := versionLessEqual(lower, openSSHVersion)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The logic is a bit convoluted here, I wonder if it'd be cleaner to append the errors. E.g.
lessEq, err1 := versionLessEqual(...)
greaterEq, err2 := versionLessEqual(...)
return lessEq && greaterEq, errors.Join(err1, err2)

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