mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-31 12:51:15 +01:00
Make JSON more robust
In cases where a finding was empty (error condition), the JSON output wasn't valid because the finding wasn't printed to file. This commit makes sure that always a finding is printed, also if it is empty. FIX #1112
This commit is contained in:
parent
1bfc9ca5b8
commit
a24a502716
@ -753,7 +753,7 @@ fileout_json_print_parameter() {
|
|||||||
"$do_json" && \
|
"$do_json" && \
|
||||||
spaces=" " || \
|
spaces=" " || \
|
||||||
spaces=" "
|
spaces=" "
|
||||||
if [[ ! -z "$value" ]]; then
|
if [[ -n "$value" ]] || [[ "$parameter" == finding ]]; then
|
||||||
printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
|
printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
|
||||||
"$not_last" && printf ",\n" >> "$JSONFILE"
|
"$not_last" && printf ",\n" >> "$JSONFILE"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user