Previously it was wrongly assuming that a NUL-termianted string is passed and the whole string should be written out.
Also document this bug in the documentation of g_log_structured() to avoid surprises when using older GLib versions.
This might also be a candidate to backport to GLib 2.74 (needs docs updates then of course).
This problem was noticed with the Rust bindings where garbage was printed out because strings were not NUL-terminated (as Rust strings are not NUL-terminated but array/length tuples), see https://github.com/gtk-rs/gtk-rs-core/issues/769.