Skip to content

Commit 254d986

Browse files
committed
refactor: use errors.Join
1 parent db526a2 commit 254d986

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

detector/cve/cve202338408/cve202338408.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package cve202338408
1818
import (
1919
"bufio"
2020
"context"
21+
"errors"
2122
"fmt"
2223
"os"
2324
"os/exec"
@@ -70,13 +71,10 @@ func (Detector) Requirements() *plugin.Capabilities {
7071
func (Detector) RequiredExtractors() []string { return []string{} }
7172

7273
func isVersionWithinRange(openSSHVersion string, lower string, upper string) (bool, error) {
73-
isWithinRange, err := versionLessEqual(lower, openSSHVersion)
74+
lessEq, err1 := versionLessEqual(lower, openSSHVersion)
75+
greaterEq, err2 := versionLessEqual(openSSHVersion, upper)
7476

75-
if !isWithinRange || err != nil {
76-
return false, err
77-
}
78-
79-
return versionLessEqual(openSSHVersion, upper)
77+
return lessEq && greaterEq, errors.Join(err1, err2)
8078
}
8179

8280
// Scan checks for the presence of the OpenSSH CVE-2023-38408 vulnerability on the filesystem.

0 commit comments

Comments
 (0)