[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC][PATCH v1 03/12] json-parser: add handling for NULL to
From: |
Michael Roth |
Subject: |
[Qemu-devel] [RFC][PATCH v1 03/12] json-parser: add handling for NULL token list |
Date: |
Fri, 25 Mar 2011 14:47:50 -0500 |
Currently a NULL token list will crash the parser, instead we have it
pass back a NULL QObject.
Signed-off-by: Michael Roth <address@hidden>
---
json-parser.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/json-parser.c b/json-parser.c
index 58e973b..849e215 100644
--- a/json-parser.c
+++ b/json-parser.c
@@ -633,9 +633,13 @@ QObject *json_parser_parse(QList *tokens, va_list *ap)
QObject *json_parser_parse_err(QList *tokens, va_list *ap, Error **errp)
{
JSONParserContext ctxt = {};
- QList *working = qlist_copy(tokens);
+ QList *working;
QObject *result;
+ if (!tokens) {
+ return NULL;
+ }
+ working = qlist_copy(tokens);
result = parse_value(&ctxt, &working, ap);
QDECREF(working);
--
1.7.0.4
[Qemu-devel] [RFC][PATCH v1 04/12] qapi: fix function name typo in qmp-gen.py, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 06/12] qmp proxy: build qemu with guest proxy dependency, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 03/12] json-parser: add handling for NULL token list,
Michael Roth <=
[Qemu-devel] [RFC][PATCH v1 08/12] qemu-char: add qmp_proxy chardev, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 11/12] guest agent: guest-side command implementations, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 09/12] guest agent: core marshal/dispatch interfaces, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 12/12] guest agent: build qemu-ga, add QEMU-wide gio dep, Michael Roth, 2011/03/25
[Qemu-devel] [RFC][PATCH v1 07/12] qmp proxy: core code for proxying qmp requests to guest, Michael Roth, 2011/03/25