qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/58] QObject patches for 2018-08-24
@ 2018-08-24 19:31 Markus Armbruster
  2018-08-24 19:31 ` [Qemu-devel] [PULL 01/58] docs/interop/qmp-spec: How to force known good parser state Markus Armbruster
                   ` (58 more replies)
  0 siblings, 59 replies; 60+ messages in thread
From: Markus Armbruster @ 2018-08-24 19:31 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 1dfb85a8755096beecf182a617493d539259cbea:

  Merge remote-tracking branch 'remotes/juanquintela/tags/check/20180822' into staging (2018-08-24 14:46:31 +0100)

are available in the Git repository at:

  git://repo.or.cz/qemu/armbru.git tags/pull-qobject-2018-08-24

for you to fetch changes up to 37aded92c27d0e56cd27f1c29494fc9f8c873cdd:

  json: Update references to RFC 7159 to RFC 8259 (2018-08-24 20:27:14 +0200)

----------------------------------------------------------------
QObject patches for 2018-08-24

JSON is such a simple language, so writing a parser should be easy,
shouldn't it?  Well, the evidence is in, and it's a lot of patches.
Summary of fixes:

* Reject ASCII control characters in strings as RFC 7159 specifies

* Reject all invalid UTF-8 sequences, not just some

* Reject invalid \uXXXX escapes

* Implement \uXXXX surrogate pairs as specified by RFC 7159

* Don't ignore \u0000 silently, map it to \xC0\80 (modified UTF-8)

* qobject_from_json() is ridicilously broken for input containing more
  than one value, fix

* Don't ignore trailing unterminated structures

* Less cavalierly cruel error reporting

Topped off with tests and cleanups.

----------------------------------------------------------------
Marc-André Lureau (2):
      json: remove useless return value from lexer/parser
      json-parser: simplify and avoid JSONParserContext allocation

Markus Armbruster (56):
      docs/interop/qmp-spec: How to force known good parser state
      check-qjson: Cover multiple JSON objects in same string
      check-qjson: Cover blank and lexically erroneous input
      check-qjson: Cover whitespace more thoroughly
      qmp-cmd-test: Split off qmp-test
      qmp-test: Cover syntax and lexical errors
      test-qga: Clean up how we test QGA synchronization
      check-qjson: Cover escaped characters more thoroughly, part 1
      check-qjson: Streamline escaped_string()'s test strings
      check-qjson: Cover escaped characters more thoroughly, part 2
      check-qjson: Consolidate partly redundant string tests
      check-qjson: Cover UTF-8 in single quoted strings
      check-qjson: Simplify utf8_string()
      check-qjson: Fix utf8_string() to test all invalid sequences
      check-qjson qmp-test: Cover control characters more thoroughly
      check-qjson: Cover interpolation more thoroughly
      json: Fix lexer to include the bad character in JSON_ERROR token
      json: Reject unescaped control characters
      json: Revamp lexer documentation
      json: Tighten and simplify qstring_from_escaped_str()'s loop
      check-qjson: Document we expect invalid UTF-8 to be rejected
      json: Reject invalid UTF-8 sequences
      json: Report first rather than last parse error
      json: Leave rejecting invalid UTF-8 to parser
      json: Accept overlong \xC0\x80 as U+0000 ("modified UTF-8")
      json: Leave rejecting invalid escape sequences to parser
      json: Simplify parse_string()
      json: Reject invalid \uXXXX, fix \u0000
      json: Fix \uXXXX for surrogate pairs
      check-qjson: Fix and enable utf8_string()'s disabled part
      json: Have lexer call streamer directly
      json: Redesign the callback to consume JSON values
      json: Don't pass null @tokens to json_parser_parse()
      json: Don't create JSON_ERROR tokens that won't be used
      json: Rename token JSON_ESCAPE & friends to JSON_INTERP
      json: Treat unwanted interpolation as lexical error
      json: Pass lexical errors and limit violations to callback
      json: Leave rejecting invalid interpolation to parser
      json: Replace %I64d, %I64u by %PRId64, %PRIu64
      json: Improve names of lexer states related to numbers
      qjson: Fix qobject_from_json() & friends for multiple values
      json: Fix latent parser aborts at end of input
      json: Fix streamer not to ignore trailing unterminated structures
      json: Assert json_parser_parse() consumes all tokens on success
      qjson: Have qobject_from_json() & friends reject empty and blank
      json: Enforce token count and size limits more tightly
      json: Streamline json_message_process_token()
      json: Unbox tokens queue in JSONMessageParser
      json: Make JSONToken opaque outside json-parser.c
      qobject: Drop superfluous includes of qemu-common.h
      json: Clean up headers
      tests/drive_del-test: Fix harmless JSON interpolation bug
      json: Keep interpolation state in JSONParserContext
      json: Improve safety of qobject_from_jsonf_nofail() & friends
      json: Support %% in JSON strings when interpolating
      json: Update references to RFC 7159 to RFC 8259

 MAINTAINERS                      |    1 +
 block.c                          |    5 -
 docs/interop/qmp-spec.txt        |   42 +-
 include/qapi/qmp/json-lexer.h    |   56 --
 include/qapi/qmp/json-parser.h   |   36 +-
 include/qapi/qmp/json-streamer.h |   46 --
 include/qapi/qmp/qerror.h        |    3 -
 include/qapi/qmp/qnum.h          |    2 +-
 include/qemu/unicode.h           |    1 +
 monitor.c                        |   21 +-
 qapi/introspect.json             |    2 +-
 qapi/qmp-dispatch.c              |    1 -
 qapi/qobject-input-visitor.c     |    5 -
 qga/main.c                       |   15 +-
 qobject/json-lexer.c             |  317 +++++-------
 qobject/json-parser-int.h        |   54 ++
 qobject/json-parser.c            |  379 +++++++-------
 qobject/json-streamer.c          |  126 +++--
 qobject/qbool.c                  |    1 -
 qobject/qjson.c                  |   31 +-
 qobject/qlist.c                  |    1 -
 qobject/qnull.c                  |    1 -
 qobject/qnum.c                   |    1 -
 qobject/qobject.c                |    1 -
 qobject/qstring.c                |    1 -
 tests/Makefile.include           |    3 +
 tests/check-qjson.c              | 1058 ++++++++++++++++++++------------------
 tests/drive_del-test.c           |    8 +-
 tests/libqtest.c                 |   57 +-
 tests/libqtest.h                 |   13 +
 tests/qmp-cmd-test.c             |  213 ++++++++
 tests/qmp-test.c                 |  252 +++------
 tests/test-qga.c                 |    3 +-
 util/unicode.c                   |   69 ++-
 34 files changed, 1484 insertions(+), 1341 deletions(-)
 delete mode 100644 include/qapi/qmp/json-lexer.h
 delete mode 100644 include/qapi/qmp/json-streamer.h
 create mode 100644 qobject/json-parser-int.h
 create mode 100644 tests/qmp-cmd-test.c

-- 
2.17.1

^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2018-08-25  9:59 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-24 19:31 [Qemu-devel] [PULL 00/58] QObject patches for 2018-08-24 Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 01/58] docs/interop/qmp-spec: How to force known good parser state Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 02/58] check-qjson: Cover multiple JSON objects in same string Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 03/58] check-qjson: Cover blank and lexically erroneous input Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 04/58] check-qjson: Cover whitespace more thoroughly Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 05/58] qmp-cmd-test: Split off qmp-test Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 06/58] qmp-test: Cover syntax and lexical errors Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 07/58] test-qga: Clean up how we test QGA synchronization Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 08/58] check-qjson: Cover escaped characters more thoroughly, part 1 Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 09/58] check-qjson: Streamline escaped_string()'s test strings Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 10/58] check-qjson: Cover escaped characters more thoroughly, part 2 Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 11/58] check-qjson: Consolidate partly redundant string tests Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 12/58] check-qjson: Cover UTF-8 in single quoted strings Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 13/58] check-qjson: Simplify utf8_string() Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 14/58] check-qjson: Fix utf8_string() to test all invalid sequences Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 15/58] check-qjson qmp-test: Cover control characters more thoroughly Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 16/58] check-qjson: Cover interpolation " Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 17/58] json: Fix lexer to include the bad character in JSON_ERROR token Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 18/58] json: Reject unescaped control characters Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 19/58] json: Revamp lexer documentation Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 20/58] json: Tighten and simplify qstring_from_escaped_str()'s loop Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 21/58] check-qjson: Document we expect invalid UTF-8 to be rejected Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 22/58] json: Reject invalid UTF-8 sequences Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 23/58] json: Report first rather than last parse error Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 24/58] json: Leave rejecting invalid UTF-8 to parser Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 25/58] json: Accept overlong \xC0\x80 as U+0000 ("modified UTF-8") Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 26/58] json: Leave rejecting invalid escape sequences to parser Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 27/58] json: Simplify parse_string() Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 28/58] json: Reject invalid \uXXXX, fix \u0000 Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 29/58] json: Fix \uXXXX for surrogate pairs Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 30/58] check-qjson: Fix and enable utf8_string()'s disabled part Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 31/58] json: remove useless return value from lexer/parser Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 32/58] json-parser: simplify and avoid JSONParserContext allocation Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 33/58] json: Have lexer call streamer directly Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 34/58] json: Redesign the callback to consume JSON values Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 35/58] json: Don't pass null @tokens to json_parser_parse() Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 36/58] json: Don't create JSON_ERROR tokens that won't be used Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 37/58] json: Rename token JSON_ESCAPE & friends to JSON_INTERP Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 38/58] json: Treat unwanted interpolation as lexical error Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 39/58] json: Pass lexical errors and limit violations to callback Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 40/58] json: Leave rejecting invalid interpolation to parser Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 41/58] json: Replace %I64d, %I64u by %PRId64, %PRIu64 Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 42/58] json: Improve names of lexer states related to numbers Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 43/58] qjson: Fix qobject_from_json() & friends for multiple values Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 44/58] json: Fix latent parser aborts at end of input Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 45/58] json: Fix streamer not to ignore trailing unterminated structures Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 46/58] json: Assert json_parser_parse() consumes all tokens on success Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 47/58] qjson: Have qobject_from_json() & friends reject empty and blank Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 48/58] json: Enforce token count and size limits more tightly Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 49/58] json: Streamline json_message_process_token() Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 50/58] json: Unbox tokens queue in JSONMessageParser Markus Armbruster
2018-08-24 19:31 ` [Qemu-devel] [PULL 51/58] json: Make JSONToken opaque outside json-parser.c Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 52/58] qobject: Drop superfluous includes of qemu-common.h Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 53/58] json: Clean up headers Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 54/58] tests/drive_del-test: Fix harmless JSON interpolation bug Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 55/58] json: Keep interpolation state in JSONParserContext Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 56/58] json: Improve safety of qobject_from_jsonf_nofail() & friends Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 57/58] json: Support %% in JSON strings when interpolating Markus Armbruster
2018-08-24 19:32 ` [Qemu-devel] [PULL 58/58] json: Update references to RFC 7159 to RFC 8259 Markus Armbruster
2018-08-25  9:58 ` [Qemu-devel] [PULL 00/58] QObject patches for 2018-08-24 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).