fix(ooniprobe show): correctly handle % in the JSON (#738)

This diff fixes the way in which we print JSON results inside
`ooniprobe show <ID>` by using the "%s" fmt specifier rather than
using the JSON string itself as the format string.

See https://github.com/ooni/probe/issues/2082

FWIW, `ooniprobe show --batch <ID>` was already WAI.
This commit is contained in:
Simone Basso 2022-05-18 16:56:13 +02:00 committed by GitHub
parent cced980387
commit 30e1ed9f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,6 +137,6 @@ func logMeasurementJSON(w io.Writer, f log.Fields) error {
if err != nil {
return err
}
fmt.Fprintf(w, string(json))
fmt.Fprintf(w, "%s", string(json))
return nil
}