]> Git Repo - qemu.git/commit - qobject/json-parser.c
json: Reject invalid \uXXXX, fix \u0000
authorMarkus Armbruster <[email protected]>
Thu, 23 Aug 2018 16:39:55 +0000 (18:39 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 24 Aug 2018 18:26:37 +0000 (20:26 +0200)
commit46a628b1398ae6a58d6847223736431225c4c0cc
tree53e184c57fb6767ec72bb336e5770f65f9f969c8
parentde6decfe8e2939464fc27ac2ab4ef87689329fec
json: Reject invalid \uXXXX, fix \u0000

The JSON parser translates invalid \uXXXX to garbage instead of
rejecting it, and swallows \u0000.

Fix by using mod_utf8_encode() instead of flawed wchar_to_utf8().

Valid surrogate pairs are now differently broken: they're rejected
instead of translated to garbage.  The next commit will fix them.

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