Markus Armbruster
dd98e84819
qjson: Have qobject_from_json() & friends reject empty and blank
...
The last case where qobject_from_json() & friends return null without
setting an error is empty or blank input. Callers:
* block.c's parse_json_protocol() reports "Could not parse the JSON
options". It's marked as a work-around, because it also covered
actual bugs, but they got fixed in the previous few commits.
* qobject_input_visitor_new_str() reports "JSON parse error". Also
marked as work-around. The recent fixes have made this unreachable,
because it currently gets called only for input starting with '{'.
* check-qjson.c's empty_input() and blank_input() demonstrate the
behavior.
* The other callers are not affected since they only pass input with
exactly one JSON value or, in the case of negative tests, one error.
Fail with "Expecting a JSON value" instead of returning null, and
simplify callers.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-48-armbru@redhat.com>
2018-08-24 20:26:37 +02:00
..
2018-06-15 16:10:11 -03:00
2018-08-03 11:35:21 +03:00
2018-08-15 10:12:35 +08:00
2018-06-08 14:39:24 -03:00
2018-08-16 14:05:28 +01:00
2018-06-08 14:39:24 -03:00
2018-08-23 18:46:25 +02:00
2018-06-08 14:39:24 -03:00
2018-08-15 07:24:22 +02:00
2018-08-21 15:20:37 -04:00
2018-07-31 09:57:25 +02:00
2018-08-24 11:31:28 +01:00
2018-07-24 11:45:25 +01:00
2018-08-16 09:50:54 +01:00
2018-08-23 18:46:25 +02:00
2018-07-02 15:41:17 +02:00
2018-07-02 15:41:17 +02:00
2018-07-02 15:41:17 +02:00
2018-06-11 22:19:57 +03:00
2018-08-23 18:46:25 +02:00
2018-06-08 13:17:39 -04:00
2018-08-21 14:28:45 +10:00
2018-08-16 08:42:06 +02:00
2018-08-15 08:12:19 +02:00
2018-06-15 14:49:44 +02:00
2018-08-24 20:26:37 +02:00
2018-05-04 08:27:53 +02:00
2018-05-04 08:27:53 +02:00
2018-05-04 08:27:53 +02:00
2018-05-04 08:27:53 +02:00
2018-07-28 09:09:58 +02:00
2018-07-28 09:09:58 +02:00
2018-08-23 18:46:23 +02:00
2018-07-03 13:04:38 +01:00
2018-07-03 13:04:38 +01:00
2018-07-24 17:33:39 +01:00
2018-08-23 18:46:25 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-23 18:46:25 +02:00
2018-08-15 12:50:39 +02:00
2018-08-16 14:05:28 +01:00
2018-08-16 09:50:54 +01:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-24 20:26:37 +02:00
2018-08-24 20:26:37 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-24 20:25:48 +02:00
2018-08-23 13:32:50 +02:00
2018-08-16 08:42:06 +02:00
2018-06-08 13:15:32 +01:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-07-09 14:51:34 +01:00
2018-05-04 08:27:53 +02:00
2018-05-04 08:27:53 +02:00
2018-06-15 07:42:55 -10:00
2018-08-24 20:25:48 +02:00
2018-08-24 20:26:37 +02:00
2018-08-23 18:46:23 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-03-27 13:05:28 +01:00
2018-07-10 10:36:15 +02:00
2018-05-30 13:31:01 +02:00
2018-05-30 13:31:01 +02:00
2018-08-23 18:46:25 +02:00
2018-07-24 17:35:57 +01:00
2018-07-24 17:36:12 +01:00
2018-07-02 15:41:10 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-06-18 17:04:56 +02:00
2018-08-23 18:46:23 +02:00
2018-07-24 17:35:57 +01:00
2018-07-02 15:41:10 +02:00
2018-05-04 08:27:53 +02:00
2018-07-02 15:41:10 +02:00
2018-08-24 20:26:37 +02:00
2018-06-15 07:42:55 -10:00
2018-08-15 07:24:22 +02:00
2018-06-29 12:22:28 +01:00
2018-08-16 08:42:06 +02:00
2018-05-04 08:27:53 +02:00
2018-08-23 18:46:25 +02:00
2018-08-23 18:46:25 +02:00
2018-08-23 18:46:25 +02:00
2018-06-15 14:49:44 +02:00
2018-05-20 08:48:13 +03:00
2018-07-23 14:00:03 +02:00
2018-05-04 08:27:53 +02:00
2018-07-24 17:35:23 +01:00
2018-08-23 18:46:25 +02:00
2018-06-08 13:15:32 +01:00
2018-06-06 15:44:07 -04:00
2018-03-29 17:41:03 -04:00
2018-05-20 08:38:38 +03:00
2018-06-29 12:22:28 +01:00
2018-06-06 15:44:07 -04:00
2018-06-06 15:44:07 -04:00
2018-06-06 15:44:12 -04:00
2018-08-16 08:42:06 +02:00
2018-06-06 15:44:12 -04:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-05-24 21:14:11 +03:00
2018-08-23 18:46:25 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-23 13:32:50 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-08-16 08:42:06 +02:00
2018-05-04 08:27:53 +02:00