File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,15 @@ package cpe
2
2
3
3
import (
4
4
"fmt"
5
+ "log"
6
+ "maps"
7
+ "slices"
5
8
"strings"
6
9
7
10
"github.com/hashicorp/go-version"
11
+ "github.com/knqyf263/go-cpe/naming"
8
12
9
13
"github.com/future-architect/vuls/contrib/snmp2cpe/pkg/snmp"
10
- "github.com/future-architect/vuls/contrib/snmp2cpe/pkg/util"
11
14
)
12
15
13
16
// Convert ...
@@ -424,7 +427,16 @@ func Convert(result snmp.Result) []string {
424
427
return []string {}
425
428
}
426
429
427
- return util .Unique (cpes )
430
+ m := make (map [string ]struct {}, len (cpes ))
431
+ for _ , c := range cpes {
432
+ if _ , err := naming .UnbindFS (c ); err != nil {
433
+ log .Printf ("WARN: skip %q. err: %s" , c , err )
434
+ continue
435
+ }
436
+ m [c ] = struct {}{}
437
+ }
438
+
439
+ return slices .Collect (maps .Keys (m ))
428
440
}
429
441
430
442
func detectVendor (r snmp.Result ) string {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments