Merge pull request #658 from AlGreed/2.9dev

Fixed #657: Severity flag for JSON-PRETTY produces malformad JSON object
This commit is contained in:
Dirk Wetter
2017-03-18 13:12:40 +01:00
committed by GitHub
2 changed files with 54 additions and 1 deletions

View File

@ -955,7 +955,7 @@ fileout() { # ID, SEVERITY, FINDING, CVE, CWE, HINT
local cwe="$5"
local hint="$6"
if show_finding "$severity"; then
if ( "$do_pretty_json" && [[ "$1" == "service" ]] ) || show_finding "$severity"; then
local finding=$(strip_lf "$(newline_to_spaces "$(strip_quote "$3")")")
is_json_format && (fileout_json_finding "$1" "$severity" "$finding" "$cve" "$cwe" "$hint")