Skip to content

Commit

Permalink
Fix issue with undefined macroVector on show details
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Sappington committed Apr 16, 2024
1 parent 9223a9d commit 47a395e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const app = Vue.createApp({
cvssSelected: null,
header_height: 0,
lookup: cvssLookup_global,
macroVector: null
}
},
methods: {
Expand Down Expand Up @@ -106,6 +107,8 @@ const app = Vue.createApp({
for (key in toSelect) {
this.cvssSelected[key] = toSelect[key]
}
this.macroVector = macroVector(this.cvssSelected)

},
onReset() {
window.location.hash = ""
Expand Down Expand Up @@ -145,7 +148,8 @@ const app = Vue.createApp({
return cvss_score(
this.cvssSelected,
this.lookup,
this.maxSeverityData)
this.maxSeverityData,
this.macroVector)
},
qualScore() {
if (this.score == 0) {
Expand Down
3 changes: 1 addition & 2 deletions cvss_score.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function cvss_score(cvssSelected, lookup, maxSeverityData) {
function cvss_score(cvssSelected, lookup, maxSeverityData, macroVectorResult) {
// The following defines the index of each metric's values.
// It is used when looking for the highest vector part of the
// combinations produced by the MacroVector respective highest vectors.
Expand All @@ -23,7 +23,6 @@ function cvss_score(cvssSelected, lookup, maxSeverityData) {

E_levels = {'U': 0.2, 'P': 0.1, 'A': 0}

macroVectorResult = macroVector(cvssSelected)

// Exception for no impact on system (shortcut)
if (["VC", "VI", "VA", "SC", "SI", "SA"].every((metric) => m(cvssSelected, metric) == "N")) {
Expand Down

0 comments on commit 47a395e

Please sign in to comment.