Skip to content

Commit 90aad01

Browse files
committed
Few bug fixes to be cleaned up
Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
1 parent bc33717 commit 90aad01

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

sig-security-tooling/srctl/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func Run() error {
151151
return fmt.Errorf("failed to flush state to disk: %w", err)
152152
}
153153
st.SetStatus(fmt.Sprintf("successfully saved to file %s.json", st.CVE))
154-
fmt.Println(st.ToProcessedData())
154+
// fmt.Println(st.ToProcessedData())
155155
case 'j':
156156
st.NextFocus()
157157
st.SetStatus(fmt.Sprintf("scrolled to %d", st.GetFocus()))

sig-security-tooling/srctl/state/data.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package state
33
import (
44
"bytes"
55
"fmt"
6-
"log"
76
"net/url"
87
"regexp"
98
"strings"
@@ -61,13 +60,13 @@ func parseCVSS(cvssURL string) (CVSS, error) {
6160
default: // Should be CVSS v2.0 or is invalid
6261
cvss, err := gocvss20.ParseVector(out.Vector)
6362
if err != nil {
64-
log.Fatal(err)
63+
return CVSS{}, fmt.Errorf("failed to parse CVSS:2.0 vector %q: %w", out.Vector, err)
6564
}
6665
out.Score = cvss.BaseScore()
6766
case strings.HasPrefix(out.Vector, "CVSS:3.0"):
6867
cvss, err := gocvss30.ParseVector(out.Vector)
6968
if err != nil {
70-
log.Fatal(err)
69+
return CVSS{}, fmt.Errorf("failed to parse CVSS:3.0 vector %q: %w", out.Vector, err)
7170
}
7271
out.Score = cvss.BaseScore()
7372
out.Severity, err = gocvss30.Rating(cvss.BaseScore())
@@ -77,7 +76,7 @@ func parseCVSS(cvssURL string) (CVSS, error) {
7776
case strings.HasPrefix(out.Vector, "CVSS:3.1"):
7877
cvss, err := gocvss31.ParseVector(out.Vector)
7978
if err != nil {
80-
log.Fatal(err)
79+
return CVSS{}, fmt.Errorf("failed to parse CVSS:3.1 vector %q: %w", out.Vector, err)
8180
}
8281
out.Score = cvss.BaseScore()
8382
out.Severity, err = gocvss31.Rating(cvss.BaseScore())
@@ -87,7 +86,7 @@ func parseCVSS(cvssURL string) (CVSS, error) {
8786
case strings.HasPrefix(out.Vector, "CVSS:4.0"):
8887
cvss, err := gocvss40.ParseVector(out.Vector)
8988
if err != nil {
90-
log.Fatal(err)
89+
return CVSS{}, fmt.Errorf("failed to parse CVSS:4.0 vector %q: %w", out.Vector, err)
9190
}
9291
out.Score = cvss.Score()
9392
out.Severity, err = gocvss40.Rating(cvss.Score())

0 commit comments

Comments
 (0)