aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* json-parser: Fix segfault on malformed inputKevin Wolf2010-04-091-1/+1
| | | | | | | | | | 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: fix PRId64 on Win32Roy Tam2010-02-231-1/+2
| | | | | | | | | | | OK we are fooled by the json lexer and parser. As we use %I64d to print 'long long' variables in Win32, but lexer and parser only deal with %lld but not %I64d, this patch add support for %I64d and solve 'info pci', 'powser_reset' and 'power_powerdown' assert failure in Win32. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 2c0d4b36e7fe28c569c5436f7724735e35d3c493)
* Add a JSON parserAnthony Liguori2009-11-171-0/+568
This is the third and final stage of the JSON parser. It parses lexical tokens performing grammar validation and creating the final QObject representation. It uses a recursive decent parser. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>