]> Git Repo - qemu.git/commit - tests/qmp-test.c
json: Reject unescaped control characters
authorMarkus Armbruster <[email protected]>
Thu, 23 Aug 2018 16:39:45 +0000 (18:39 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 24 Aug 2018 18:26:37 +0000 (20:26 +0200)
commit340db1ed82f8ced40a3e778c08963005369e2926
treec1fef7097ff604764f708120567b7aa608ff80be
parenta2ec6be72b80770b063cf08c95c78f0d36705355
json: Reject unescaped control characters

Fix the lexer to reject unescaped control characters in JSON strings,
in accordance with RFC 8259 "The JavaScript Object Notation (JSON)
Data Interchange Format".

Bonus: we now recover more nicely from unclosed strings.  E.g.

    {"one: 1}\n{"two": 2}

now recovers cleanly after the newline, where before the lexer
remained confused until the next unpaired double quote or lexical
error.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20180823164025[email protected]>
qobject/json-lexer.c
tests/check-qjson.c
tests/qmp-test.c
This page took 0.035291 seconds and 4 git commands to generate.