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: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
Showing