aboutsummaryrefslogtreecommitdiff
path: root/internal/cvss/cvss.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cvss/cvss.go')
-rw-r--r--internal/cvss/cvss.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/cvss/cvss.go b/internal/cvss/cvss.go
index 0e18656..9839e84 100644
--- a/internal/cvss/cvss.go
+++ b/internal/cvss/cvss.go
@@ -36,12 +36,12 @@ type Vector interface {
// Create new CVSS vector from vector string.
func NewVector(s string) (Vector, error) {
- if len(s) > len(v31Prefix) && s[:len(v31Prefix)] == v31Prefix {
- // create CVSS v2.0 vector.
- return newV31Vector(s[len(v31Prefix):])
- } else if len(s) > len(v30Prefix) && s[:len(v30Prefix)] == v30Prefix {
+ if isV31VectorString(s) {
+ // create CVSS v3.1 vector.
+ return newV31Vector(s)
+ } else if isV30VectorString(s) {
// create CVSS v3.0 vector.
- return newV30Vector(s[len(v30Prefix):])
+ return newV30Vector(s)
} else {
// create CVSS V2 vector
return newV2Vector(s)