[BZ#725397] assertion failure from malformed input
Submitted by Tim Waugh <<twa..@..com>>
Assigned to json-glib-maint@gnome.bugs
Link to original bug (#725397)
Description
json-glib fails with an assertion failure with some types of malformed JSON inputs.
See bug #723368 comment #17 for an example of this: https://bugzilla.gnome.org/show_bug.cgi?id=723368#c17
This is unfortunate because the JSON input comes from a REST response and is not under our control. A GError response would be much better: applications shouldn't crash when a server gives an expected response.
This particular case came about because the Google Cloud Print service responds to a POST /submit request with a JSON object containing the entire response, including "content" (the contents of a PDF file) as a string.