]> git.ipfire.org Git - thirdparty/qemu.git/commit
json-parser: Fix segfault on malformed input
authorKevin Wolf <kwolf@redhat.com>
Wed, 24 Feb 2010 15:17:58 +0000 (16:17 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 9 Apr 2010 16:41:59 +0000 (18:41 +0200)
commit9462695b64ef628e94d7f670feecdaa125ff5f52
tree9b99ac38609ed77201d6921253a326a6180c781c
parent5eb089588ed3e54865fe596531e2375d0a5ab3f0
json-parser: Fix segfault on malformed input

If the parser fails to parse the key in parse_pair, it will access a NULL
pointer. A simple way to trigger this is sending {foo} via QMP. This patch
turns the segfault into a syntax error reply.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit d758d90fe1f74a46042fca665036a23b4d5fe87d)
json-parser.c