From 76b6048ef9ab80f9967c47991d1156eba139662e Mon Sep 17 00:00:00 2001 From: cd-rite <61710958+cd-rite@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:52:21 -0500 Subject: [PATCH] fix: #1155 resultStats object was declared once and reused for every iSTIG element, causing stats to be cumulative for multi-stig .ckls (#1156) --- client/src/js/SM/Parsers.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/client/src/js/SM/Parsers.js b/client/src/js/SM/Parsers.js index b77e76610..479d2b7a5 100644 --- a/client/src/js/SM/Parsers.js +++ b/client/src/js/SM/Parsers.js @@ -41,17 +41,6 @@ Not_Applicable: 'notapplicable', Not_Reviewed: 'notchecked' } - const resultStats = { - pass: 0, - fail: 0, - notapplicable: 0, - notchecked: 0, - notselected: 0, - informational: 0, - error: 0, - fixed: 0, - unknown: 0 - } const parseOptions = { allowBooleanAttributes: false, attributeNamePrefix: "", @@ -155,6 +144,17 @@ // } let vulnArray = [] + let resultStats = { + pass: 0, + fail: 0, + notapplicable: 0, + notchecked: 0, + notselected: 0, + informational: 0, + error: 0, + fixed: 0, + unknown: 0 + } vulnElements?.forEach(vuln => { const review = generateReview(vuln, resultEngineCommon) if (review) {