From a5aa3a4bbf76a786d80185a5528dcce800790af3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Sun, 3 Oct 2021 18:19:24 +0200 Subject: [PATCH] Fix invalid JSON when certificate issuer contains non-ASCII chars Changed printf %s to printf %b which cause now to output UTF-8 correctly. See #1992 --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 7f21f38..17bbf66 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1185,7 +1185,7 @@ fileout_json_print_parameter() { spaces=" " || \ spaces=" " if [[ -n "$value" ]] || [[ "$parameter" == finding ]]; then - printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE" + printf -- "%b%b%b%b" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE" "$not_last" && printf ",\n" >> "$JSONFILE" fi }